Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
Custom Color on Bar Chart
posted

I have a data table that has three columns: Text, Value1, Value2

 I need to create a bar chart of Text (as x axis label) and Value1 as the height of the bar... and I would like to use Value2 to color the bar based on a formula.

 When I load the datatable as the chart datasource, it creates two bar charts, one for value1 and one for value2.  So I have a few questions:

1. How do I indicate exactly which columns are meant to be the x and y axis (with a databind, or remove or something) but I dont want to have to "load" the datapoints by iteration (which would kill the point of having a bindable control).

2. How do I intercept the paint (or some other method) to paint the bar a specific color (the number for the value2 will be used to decide)

I spent a lot of time with the examples, but frankly they show a few things, but aren't very useful.

I hope you have help

Thanks

Jeff