C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,995 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Is it possible to empty 1 serie in a chart that is constantly being built up with the help of a timer and fill it with 1 value? So that a straight line is put in the chart for this series.
So i want to update the Yvalue of a chart.serie. I found that i can read the Yvalues of a serie, but i do not know how to update them.
(I use c# winforms)
Greatings
Check if this code meets expectations:
var points = chart1.Series[0].Points;
for( var i = 0; i < points.Count; ++i )
{
points[i].YValues[0] = 1;
}
chart1.Invalidate( );
or
foreach( var p in chart1.Series[0].Points )
{
p.YValues[0] = 1;
}
chart1.Invalidate( );