This is the first time I have ever worked with a chart of any kind and I am struggling a bit to find a way to do the simple things I want to do. I know there must be a property somewhere, but I have not found it. I am using a stacked column chart. The first issue that I am trying to resolve is when there are multiple data values stacked, when I hover over each area, the tooltip displays a cumulative number (a sum) as you move up the stack instead of displaying the actual data value for that area. For example, if I have a stack made up of 3 areas, the first value is 5, the second value is 10 and the third value is 5, when I hover over the bottom area, the tooltip is 5, but when I hover over the second area, the tooltip is 15. I expect this to be 10. When I hover over the third area, the tooltip is 20. I expect this value to be 5. What do I need to do to get this expected behavior? Also, I need to add some additional text to the tooltip and see that I should be able to use the FillSceneGraph method to accomplish this, but I’m having difficulty finding the primitives for the boxes that make up my stack. Is there a good tutorial somewhere that will enable me to familiarize myself with the stacked column chart and how to work with it? I have been through the forum and I’m still going through it, but thought I would go ahead and get my questions out there to see if I could get some help. Thanks, Sabrina
Hello Sabrina.
By default, the StackedColumn chart will display the aggregate values for the column. To modify the tooltip to display the value of each individual item, you can change the chart's Tootips.FormatString to "<DATA_VALUE_ITEM>".
this.ultraChart1.Tooltips.FormatString = "<DATA_VALUE_ITEM>";
If you want to add custom text to the tooltip, you'll need to utilitize the IRenderLabel interface. The basis to this mechanism is you implement an ToString() method for this interface, and associate the interface implementation with a string token. When the chart encounters this token in the FormatString properties, it will call the ToString() method. I've attached simple sample that demonstrates using the interface.
If you haven't already found it, here is a link to our online help for the UltraChart.
Let me know if you have any further questions.
Chris
OMG, this is awesome! This really was helpful. I was just having trouble finding information to help me put this together. These responses were exactly what I needed. The only remaining issue is that one of the things I want to put into the tooltip is the percentage that each data_value_item is to the total (data_value), but it looks like the data_value is unaware of the stack as a whole at the bottom of the stack. So if I have a stack of 2 items, the bottom item is 4 and the other is 7, when I hover over the bottom item, I get 100%. My expectation is that would be 37%. Is there a way to resolve that?
Thanks
Sabrina