Profile Picture

Problems with pie charts

Posted By Tal Harari 14 Years Ago
Author
Message
Tal Harari
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 19, Visits: 2
Hello,

I am having some trouble with pie graphs in nevron chart for .net.

first of all, the design for pie charts are diffrent from bar charts..
a bar chart contains series (like price, amount and such) but a pie chart can contain only one series and that series is an entire pie - its "series" are actually datapoints...

i want to be able to hide "series" in both bar chart and pie chart.
in bar chart i have "visible" property for the "amount" series for example.
in a pie chart if i want to hide the "amount" slice it is actually a datapoint and has no "visible" property.

How can i hide a slice from a pie chart? i dont want it to be seen in the pie itself or the legend.
and i want to be able to show it aferwards...

I would very much appreciate any help in this subject,
Thanks in advance,
Tal Harari

Milen Metodiev
Posted 14 Years Ago
View Quick Profile
Forum Member

Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)

Group: Nevron Team
Last Active: 14 Years Ago
Posts: 48, Visits: 1

Hello Tal,

The design of pie and bar series is pretty consistent - both charts types have series collections that can contain one or more series. A series contains a number of data points - in the case of bar series the data points are represented by bars; in the case of pie series the data points are represented by pie slices. Currently a pie chart displays only the first pie series, but in the future it will be able to display additional series in the form of dougnut chart with multiple rings.

The Visible property is available only per series. Data points do not have individual Visible property. You can set a data point to be "Empty" by setting its value to DBNull.Value, thus making it invisible. Empty data points leave placeholders in regular bar charts, but in pie charts they are excluded from calculation and cannot be used as placeholders. If you want to create a data point placeholder in a pie chart you can set the data point's FillStyle to fully transparent and remove the data point Border.

Regarding the legend - you can use manual mode in order to add or remove legend items according to your requirements.

Best Regards,
Milen Metodiev



Tal Harari
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)Junior Member (19 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 19, Visits: 2
Thanks for the quick reply.

I could not find a way to set a datapoint's value, I can clear it but i cant find how to set its value back.
Is this possible? or do i have to create a new datapoint instead?



Milen Metodiev
Posted 14 Years Ago
View Quick Profile
Forum Member

Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)

Group: Nevron Team
Last Active: 14 Years Ago
Posts: 48, Visits: 1

Hi Tal,

In general you can use the following code:

    NDataPoint dp = bar.ComposeDataPoint(index);
    dp[DataPointValue.Y] = 55;
    bar.StoreDataPoint(index, dp);

However, if you want to change hust a single value it is more efficient to set it directly in the respective data series:

    bar.Values[index] = 55;

I hope this helps,

Best Regards,
Milen





Similar Topics


Reading This Topic