PDA

View Full Version : Update title from Series



messyOne
21 Aug 2012, 3:20 AM
Hi,

i want to update the title from my series lines in my line chart. I use Ext JS in a PHP template and have following code extract:


{
type: 'line',
xField: ['month'],
yField: ['sum2'],
title: '<?php echo rand(); ?>',
smooth: true,
style: {
stroke: '#F00'
},
markerConfig: {
type: 'circle',
size: 10,
radius: 4,
'stroke-width': 1,
fill: '#F00'
}
}

How can I reload the chart with the new legend title?

messyOne
21 Aug 2012, 3:46 AM
Utter nonsense! The script will not reload so I haven't a chance to get a new random value. Ok, I tell you what I want. By a click on a button the proxy.url will be changed and load with an AJAX request new data in the store. I need to update the line title in this moment. How can I do this?

scottmartin
21 Aug 2012, 9:28 AM
Have a look at setTitle() method to change the axis title.

Scott.

messyOne
21 Aug 2012, 11:21 PM
It isn't the axis title which has to change, but the title of a serie (type: line).

scottmartin
26 Aug 2012, 6:15 PM
Should be the same with Series:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.chart.series.Line-method-setTitle

Scott.