Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
line chart help me
wangchen
I want to create a line chart like that when the line's axis(X) is over a certain value the color of the line will be changed.(like the attachment)<br />
I want to use the javascript in the BIRT report designer,But up to now I have never use of the Line Chart javascript API. <br />
How can do it, teach me please!thanks very much!<br />
<br />
E_mail:wangchen188996@163.com<br />
MSN : <a href='mailto:' title='E-mail Link' class='bbc_email'>wang188996@hotmail.com</a><br />
<br />
You can mail to me.<br />
<br />
I want to make some friends,if you travel in Chinese Beijing,I can be a free guide of you!<br />
<br />
My English is a little poor,sorry.
Find more posts tagged with
Comments
madhu_2009
Hi..
Add a marker on X- Axis and add this code in the script tab (on render)of your line chart.
Here in the below code my marker value is 4. so if the line crosses 4 the color is red,else in green. hope this helps u..
function beforeDrawDataPoint(dataPointHints, fill, scriptContext ){
val = dataPointHints.getOrthogonalValue();
chart = scriptContext.getChartInstance();
marker = 4//chart.getAxes().get(0).getAssociatedAxes().get(0).getMarkerLines().get(0).getValue().getValue();
if (val > marker) //crosses marker?
fill.set(0,255,0); //yes - display in red
else
fill.set(254, 102, 0); //no - display in blue
}
regards,
Madhu
wangchen
<blockquote class='ipsBlockquote' data-author="madhu_2009"><p>Hi..<br />
<br />
Add a marker on X- Axis and add this code in the script tab (on render)of your line chart.<br />
Here in the below code my marker value is 4. so if the line crosses 4 the color is red,else in green. hope this helps u..<br />
<br />
function beforeDrawDataPoint(dataPointHints, fill, scriptContext ){<br />
val = dataPointHints.getOrthogonalValue();<br />
chart = scriptContext.getChartInstance();<br />
marker = 4//chart.getAxes().get(0).getAssociatedAxes().get(0).getMarkerLines().get(0).getValue().getValue();<br />
if (val > marker) //crosses marker?<br />
fill.set(0,255,0); //yes - display in red<br />
else<br />
fill.set(254, 102, 0); //no - display in blue<br />
}<br />
<br />
regards,<br />
Madhu</p></blockquote>
<br />
Hi<br />
<br />
thank you very much.<br />
<br />
Can you tell me how to change the color of the curve?which function is used to change che curve line?<br />
<br />
I have done as you told me, The color of the marker changed,but the color of the line didn't change.<br />
<br />
I'm a beginner of BIRT.The color of the curve is important, Help me please!<br />
<br />
thanks !
madhu_2009
Hey..
This is what i have used for a bar chart,in which the bars crossing the marker limit ultimatley changes the color. Similarly there might be a way to change the color of the line.
I will let you know if i come across that..
Rgds,
Madhu