Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Report 7d : Charts and Graphs
nuraniuscc
Hi,
Couple of questions on the above topic
1) How do I convert the input parameter value to a String and show it on the
X or Y Axis.
Eg : If Input month is "January" I want to show it as JAN in my X-Axis.
How do I Substr the 1st 3 characters.
2) I have created a Legend and provided the Optional Y-Axis Grouping. How
can I increase the area for Legend. Because, the problem I face is
My Legend deascriptions are getting chooped off.
Eg : 01 = Average
02 = Mean
03 = Minimum etc
I see in my legend
Eg : 01 = Ave
02 = Mea
03 = Mini
How do I address this issue?
Thanks
Nurani Sivakumar
Find more posts tagged with
Comments
mwilliams
Hi Nurani,
For question 1, Are you wanting to show it as the x-axis title or as the x-axis category value?
nuraniuscc
Hi Mike,
I want it to be shown as the X-Category Values. For Eg: My X - Axis is
Months to be shown as Jan, Feb, Mar etc.
Thanks
Nurani Sivakumar
mwilliams
Nurani,<br />
<br />
If you have months like "January" in your x-axis already, you can put the following in your chart script to change them to just the first 3 characters. i.e. "Jan"<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawAxisLabel(axis, label, icsc)
{
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
if (axis.getOrientation() == Orientation.HORIZONTAL_LITERAL)
{
temp = label.getCaption().getValue();
temp = temp.substr(0,3);
label.getCaption().setValue(temp);
axis.setLabel(label);
}
}
</pre>
nuraniuscc
Hi Mike,
On my X- Axis, I have 01 thru 12 for my months. So I need to decode them as 01 means Jan, 08 means Aug etc.
I believe I need to change the above code. Please show me the snapshot of How I do it?
Also, You didn't answer my 2nd question from Post # 1 (Talks about increasing the area for the Legend)
Thanks
Nurani Sivakumar
mwilliams
Nurani,
If you have 01-12 for your x-axis, you just need to use if statements to check when you need to change them. Make sure you do this inside the HORIZONTAL_LITERAL if statement.
nuraniuscc
Hi Mike,
Where is this HORIZONTAL-LITERAL function found? I looked in the Graph area and I coundn't find it. Is it a method or something? Please point me to where it can be found?
If you show an example statement as how to code this block that would be very helpful.
Thanks
Nurani Sivakumar
mwilliams
Nurani,
HORIZONTAL_LITERAL is just a property of the axis. There is VERTICAL_LITERAL as well. If you want to do something to just one axis, you'd need to check for this. For the script, you can use the above script, only you'll need to do an if statement that checks temp for each month's numeric value and replaces it with the string value.
nuraniuscc
Mike,
Tell me How do I do the following. These seems to be common issues.
1) How do I "Stack" the Report Horizontally. It's got something to do with
"Y Series". I don't quite remember How to set them up.
Along with this the "Optional Y series is also confusing to me". Please
distinguish between the above two. When do we use them?
(In my case, I try to set the Months as series, but when I hit "Next"
and come "Back" that field is wiped out"...Any clues ?)
2) How do I color code the different series and show them in the Legend with
the Text that I want to display.
Eg: Month 01 should be translated to JAN.
I believe, the color scheme is automatically displayed as there are more
series to display.
Please explain.
Thanks
Nurani Sivakumar
mwilliams
Nurani,
What do you mean by '"stack" the report horizontally'? Are you talking about a horizontal chart rather than a vertical chart? Let me know.
The Y-Series of the chart is what measure the chart is displaying. The Optional Y-Series Grouping is a way to group the Y-Series values by another field.
As there are more series', the chart is colored in the order of the series palette.
For the legend names, you can modify them in the chart script. If you need help figuring this out, let me know.
Hope this helps.
nuraniuscc
Hi Mike,
By "Stacking" I mean vertical bars next to each other. Eg: If I have 6 markets for each month, I want to display 6 vertical bars next to each other for a single month. It will still be vertical. Horizontal means the bars will go from Left to Right. (That's how I understand).
So, I want a report for 6 months each displaying the Average for the 6 markets, My understanding is
X - Axis will be the MONTH
y - Series will be the MARKET
Y - Optional will be the AVERAGE.
So I get to see 6 vertical bars for each month each with different color.
But, the challenge I face is when I do this, and click "NEXT" on the Chart Graph window and go back by clicking on the "BACK" button, I see my Y- Series entry is wiped out.
It's so strange, I am not sure what might be the cause of it.
Thanks
Nurani Sivakumar
mwilliams
Nurani,
Check out this example.