Nov 14, 2012, 12:35 PM
[CLOSED] [#18] Chart: Single Column Series yField incorrect
This is related to a discussion in a previous thread.
I use the value of the item.yField to perform some actions and it works perfectly when there are more than one YField defined in a columns series, but if there is only one the yField is a single character (e.g. 'D') instead of the full name (e.g. 'Data1').
If believe this is occurring deep in the logic because the series yField could be a string (if only one field) or a string collection (if multiple fields).
Use your Chart -> Column -> Basic example and inspect the items yField or change the tip renderer to add the yField.
Suggestion: You should also probably change the tip renderer to not hard code storeItem.get('Data1') incase someone wanted to extended your example with additional series Data2, Data3, ... Use item.value[1] instead.
Original Code
With one data series the tip will be 'D | Nov: ##', but with two or more series the tip will be 'Data1 | Nov: ##' or 'Data2 | Nov: ##'.
I use the value of the item.yField to perform some actions and it works perfectly when there are more than one YField defined in a columns series, but if there is only one the yField is a single character (e.g. 'D') instead of the full name (e.g. 'Data1').
If believe this is occurring deep in the logic because the series yField could be a string (if only one field) or a string collection (if multiple fields).
Use your Chart -> Column -> Basic example and inspect the items yField or change the tip renderer to add the yField.
Suggestion: You should also probably change the tip renderer to not hard code storeItem.get('Data1') incase someone wanted to extended your example with additional series Data2, Data3, ... Use item.value[1] instead.
Original Code
<Tips runat="server" TrackMouse="true" Width="140" Height="28">
<Renderer Handler="this.setTitle(item.yField + ' : ' + storeItem.get('Name') + ': ' + storeItem.get('Data1'));" />
</Tips>
Updated Code<Tips runat="server" TrackMouse="true" Width="140" Height="28">
<Renderer Handler="this.setTitle(item.yField + ' | ' + item.value[0].substr(0,3) + ': ' + item.value[1]);" />
</Tips>
Now add an additional series Data2 and see what the tip renderer produces.With one data series the tip will be 'D | Nov: ##', but with two or more series the tip will be 'Data1 | Nov: ##' or 'Data2 | Nov: ##'.
Last edited by Daniil; Dec 29, 2012 at 11:16 AM.
Reason: [CLOSED]