0
votes

When all the values ​​for N categories shown in a pie chart are zero, the chart is a circle with N equal sectors.

I tried using DataFilter as below, but then, nothing is shown at all (no chart, no legend information)

DataFilter dataFilter1 = new DataFilter("Amount", "System.Int32",      
    DataFilterCondition.GreaterThan, 0);
series.DataFilters.Add(dataFilter1);

Is there a way to show an empty (filled with white for example?) chart in such conditions?

2
set all lines & fills to the same (white) colour? – mcalex
I guess I should do something like that.. Thanks. – Yalda

2 Answers

2
votes

you can do something like this

 // Create an empty chart.
 ChartControl pieChart = new ChartControl();

 // Create a pie series.
 Series series1 = new Series("A Pie Series", ViewType.Pie);

 // Populate the series with points.
 series1.Points.Add(new SeriesPoint("No Results found", 100));

 // Add the series to the chart.
 pieChart.Series.Add(series1);
1
votes

If the data you are using to build your pie graphs are already percentiles, (computed at retrieval), pChart.Series[pData.TableName].Label = "#VALX (#VALY%)"; will do the trick

oops.. i was searching for a solution on 'Series Label (NaN)' on DataVisualization pie charts when totals are zero