notzippy
05-31-2006, 08:07 AM
I know the charts are "use at your own risk", anyways I thought Id post some quick fixes to common errors.
In order to create a chart on a changing datapath the interval must always readjust.
Modify axis.lzx in setAutomaticMinMaxRender (Partial code shown)
...
//If interval is not defined, calculate one
// Changed to always recalculate the interval
if( this.interval == null || true) {
this.interval = calculateAutomaticInterval(lRange);
}
...
In order for the legend to be updatable you need to add a delegate to listen to changes in the dataseries. Something like the following works.
Modify legend.lzx method oninitdone (add new method redrawLegend)
<!--- @keywords private -->
<method event="oninitdone" reference="this.chart">
if(chart.initdone)
{
var lChart = this.getChartInstance();
if( lChart != null ) {
this.chartClassName = lChart.classname;
this.datapath.setFromPointer(lChart.getDataSeries( ).getLegend());
new LzDelegate(this,"redrawLegend", lChart.getDataSeries(), "ondatadone");
}
}
</method>
<!--- @keywords private -->
<method name="redrawLegend">
var lChart = this.getChartInstance();
this.datapath.setFromPointer(lChart.getDataSeries( ).getLegend());
</method>
There are further problems with the legend in dataseries.lzx the getLegend method refers directly to canvas["legendds"] as the dataset for the legend. So if you are having issues with multiple legends I imagine that is the source..
Z
In order to create a chart on a changing datapath the interval must always readjust.
Modify axis.lzx in setAutomaticMinMaxRender (Partial code shown)
...
//If interval is not defined, calculate one
// Changed to always recalculate the interval
if( this.interval == null || true) {
this.interval = calculateAutomaticInterval(lRange);
}
...
In order for the legend to be updatable you need to add a delegate to listen to changes in the dataseries. Something like the following works.
Modify legend.lzx method oninitdone (add new method redrawLegend)
<!--- @keywords private -->
<method event="oninitdone" reference="this.chart">
if(chart.initdone)
{
var lChart = this.getChartInstance();
if( lChart != null ) {
this.chartClassName = lChart.classname;
this.datapath.setFromPointer(lChart.getDataSeries( ).getLegend());
new LzDelegate(this,"redrawLegend", lChart.getDataSeries(), "ondatadone");
}
}
</method>
<!--- @keywords private -->
<method name="redrawLegend">
var lChart = this.getChartInstance();
this.datapath.setFromPointer(lChart.getDataSeries( ).getLegend());
</method>
There are further problems with the legend in dataseries.lzx the getLegend method refers directly to canvas["legendds"] as the dataset for the legend. So if you are having issues with multiple legends I imagine that is the source..
Z