In my Linechart, the tooltip is minimized to show only the DataValue because the DATA_ROW value is presented as number of timer ticks, e.g. 16 instead of four hours, 0 minutes (since I am using a 15 minute interval).
Is there some easy way to get my hands on the DATA_ROW value and format it as HH:mm before it is shipped off as a tool tip?
If your line chart uses a Time axis (i.e. chart.LineChart.TreatDateTimeAsString = false) then you can just set the tooltip format string to TIME_VALUE:chart.Tooltips.FormatString = "<TIME_VALUE:HH:mm>"
If you're using a string axis, your time labels aren't really time; they're just strings that look like time. You would have to implement IRenderLabel to change those strings into time and return then via ToString(). Here's a link to the help article on using IRenderLabel:
http://help.infragistics.com/Help/NetAdvantage/NET/2007.3/CLR2.0/html/Chart_Customize_Labels_Using_the_IRenderLabel_Interface.html
How do you suppress the leaderline if you return a null string for the label?
I only want to show all slices of a piechart, but not the label and leaderline if the data_value is < 1000.
It worked. I only had to parse the label text to get the data value, since I had formatted it <Percent_Value>% $<Data_Value> <Item_Label>.
Thank you for your help.
The code should be identical with one exception: replace e.SceneGraph with scene, which is the only parameter in your FillSceneGraph method.
Let me know if that works for you.
Can you help me with the details of how to suppress the leaderlines and labels for slices of the piechart that are < $1000.
I am trying to do this with v7.2 code...
Thanks
----------------------------------------------------------------------------------------------------------------------------------------------------------
In my driver code I have the hook to access the FillSceneGraph method...
// add the layer igChart.Layer.Add("My Layer", new MyLayer()); igChart.UserLayerIndex = new string[ {"Default", "My Layer"}; igChart.InvalidateLayers(); BindDataToChart(igChart, dt);
In my layer class I have the following routine to manipulate the graph Scene...
public void FillSceneGraph(SceneGraph scene) { PrimitiveCollection primitives = new PrimitiveCollection(); /* first let's get a reference to all the columns/bars in the chart, then manipulate them. */ ArrayList allSlices = new ArrayList(); foreach (Primitive p in scene) { Wedge w = p as Wedge; if (w != null) { allSlices.Add(p); } } foreach (Wedge w in allSlices) { if ((double)w.Value > 1000) {
int index = 0; //int index = b.SceneGraph.IndexOf(label); <-------- What v7.2 codes needs to go here...
if (index == 2) {
//labels follow the leaderlines, 2 spots further in the collection. <-------- What v7.2 codes needs to go here... //Line line = b.SceneGraph[index - 2] as Line; <--------
Line line = null; if (line != null) { primitives.Add(line); } } primitives.Add(w); } } //foreach (Primitive p in primitives) <---------- What v7.2 codes needs to go here... //{ <---------- //e.SceneGraph.Remove(p); <---------- //} <----------
You can take a look at the following help article. It shows how to write the layer class and get access to the scene.http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Chart_Writing_a_Layer_Class.html
How would you do this in the 2007 Vol.2 version? I have created a custom layer for the FillSceneGraph(SceneGraph scene) method. But have not found the right methods to use instead of the FillSceneGraphEventArgs e ones available in Vol.3 version.