Reputation: 684
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?
Upvotes: 0
Views: 1243
Reputation: 333
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
Upvotes: 1
Reputation: 32681
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);
Upvotes: 2