Setting Colors on line Charts

Posted by user405247 
Setting Colors on line Charts
September 24, 2010 10:40AM
Hi,

Feel I must be doing something wrong. But cannot see it.

Trying to set line color for three different lines using XML input

I have

<div id="graph">Loading graph...</div>


<script type="text/javascript">

var myChart = new JSChart('graph', 'line');

myChart.setDataXML('MMS--in.xml','first line');
myChart.setLineColor('#ff0000','first line');

myChart.setDataXML('MMS--out.xml','second line');
myChart.setLineColor('#00ff00','second line');

myChart.setDataXML('MMS--outstanding.xml','third line');
myChart.setLineColor('#0000ff','third line');

myChart.draw();

</script>


It picks up the line color for first line, but then just uses default for second and third lines.

I have change to an array and this works.

Does the Xml Data set need to have "first line" , "second line" ,"third line" set any where.

At the moment just

<?xml version="1.0"?>
<JSChart>
<dataset type="line">
<data unit="201002" value="7"/>
<data unit="201003" value="10"/>
</dataset>
</JSChart>



Look foward to any respone

Cheers
Ray
Re: Setting Colors on line Charts
October 20, 2010 02:50PM
Hi,

I am struggling with this same thing, I am trying to set different colors for my line datasets. A slight difference is that I am only sing 1 xml file, and I have multiple datasets defined in my xml file. Were you able to identify how to set different line colors through the xml file? Thank you for your help!

-Jason
Re: Setting Colors on line Charts
November 03, 2010 02:52PM
No, waiting for help.

Works okay if using an array, but make coding harder for daily reporting.
Generally seems to be same issue
Sorry, you do not have permission to post/reply in this forum.