|
JsXYChart.getLayerCount() Always Return Zero |
Posted by Robert on May-29-2013 12:07 |
|
Hi Peter,
I have a strange issue with JsXYChart.getLayerCount() function.
I have a dynamic xy-chart which user can add multiple data series and scroll left and right
to change the date range of the graph.
I have recently added the track line code from your documentation and everything seems to
be working well.
The problem is that as soon as one of the data series contains no data, the
getLayerCount() function starts returning zero.
Ths is my VB code for adding data series:
c.addLineLayer(dataArray1, color1, seriesName1)
c.addLineLayer(dataArray2, color2, seriesName2)
And in my Javascript I have:
if(c.getLayerCount() == 0)
return;
So basically JsXYChart.getLayerCount() returns 2 normally but as soon as dataArray1.length
or dataArray2.length become 0 it starts to return 0 which is not expected.
Any help is appreciated.
Regards
Robert |
Re: JsXYChart.getLayerCount() Always Return Zero |
Posted by Peter Kwan on May-29-2013 19:01 |
|
Hi Robert,
I confirm this is in fact due to a bug in ChartDirector.
I have just uploaded an updated netchartdir.dll to our web server which can solve this problem:
http://www.advsofteng.com/netchartdir511p1.zip
Please replace your existing "netchartdir.dll" with the one in the zip file. There are two "netchartdir.dll" in the zip file, one for the unsigned version of "netchartdir.dll", and one for the signed version.
Hope this can help.
Regards
Peter Kwan |
Re: JsXYChart.getLayerCount() Always Return Zero |
Posted by Robert on May-30-2013 05:38 |
|
Hi Peter,
Just tested your new version and the problem is solved.
Thanks a lot for the quick update!
I'm still doing some regression tests on this new version before I can update our production
server.
Just wondering is there any known breaking changes from the original 5.1 .NET version?
Cheers
Robert |
Re: JsXYChart.getLayerCount() Always Return Zero |
Posted by Peter Kwan on May-30-2013 16:20 |
|
Hi Robert,
The update is based on ChartDirector for .NET 5.1.1. I am not aware of any code breaking changes to the original ChartDirector for .NET 5.1.
Regards
Peter Kwan |
Re: JsXYChart.getLayerCount() Always Return Zero |
Posted by Robert on May-31-2013 05:25 |
|
Awesome! Thank you. |
Re: JsXYChart.getLayerCount() Always Return Zero |
Posted by Loran Friedrich on Jun-09-2013 05:00 |
|
I have found a similar issue with the Ruby on Rails implementation. The number of layers in my chart in the
trackLineLegend consistently returns 0. I can send much more detail if required, but if there is a solution similar
to this thread, that would be great!
Thanks
Loran |
Re: JsXYChart.getLayerCount() Always Return Zero |
Posted by Peter Kwan on Jun-11-2013 01:54 |
|
Hi Loran,
The cause of the issue in this thread (that an empty data array causes the Javascript Chart Model to be generated incorrect) should only affects the .NET, Java and ColdFusion editions of ChartDirector. It should not affect other editions of ChartDirector.
For your case, it may be caused by another issue.
Is it possible to provide a simple example with hard coded data that can reproduce the problem (eg. by modifying the "Track Line with Legend" sample code)? If this is not possible, you may inform me the charting code you are using, and also the output of your code as seen by your browser (you may right click on the web page and save the output). If your web page is accessible from the Internet, you may provide me with the URL. I would then examine the HTML/Javascript output to see if there is any clue to the problem. If you cannot post these information in this forum, you may email me at pkwan@advsofteng.net.
Regards
Peter Kwan |
|