Change column color (Chart) with values above the limit

Asked

Viewed 879 times

0

I’m making a report for winforms using the Viewer REPORT, in this report I added a column chart. What I need to do is that before loading the report the user can choose what value is good for it, and all the columns that were above that value change their color to red.Does anyone have any idea how to do this, good doesn’t just feed the report code with a data set and use Chart’s own properties to create the series.

  • the Dataset structure is already sending the information of the value to be compared correctly?

  • Yes I just need to compare whether by Xpression or not.

1 answer

1

I managed to do it this way...

Series D = new Series("", listaLotes.Count);
            D.ChartType = SeriesChartType.Column;
            for (int i = 0; i < listaLotes.Count; i++)
            {
                D.Points.AddXY(i + 1, listaLotes[i].Media);
                if (D.Points[i].YValues[0] > 7.0)
                {
                    D.Points[i].Color = Color.Red;
                }
            }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.