Hello.!
I am a user who uses your Telerik library.
Currently, I have been programming CharView on Winfom.
In case of the program that I develop, Whenever I click a button, it draws a chart then BindingList’s data is increasing continuously.
What I want to do is that let the Scroll bar be displayed when the number of data is over 20.
However, my program does not display Scroll bar when that happens.
My code is the following.
Please respond to what I concern. Thank you.
I am a user who uses your Telerik library.
Currently, I have been programming CharView on Winfom.
In case of the program that I develop, Whenever I click a button, it draws a chart then BindingList’s data is increasing continuously.
What I want to do is that let the Scroll bar be displayed when the number of data is over 20.
However, my program does not display Scroll bar when that happens.
My code is the following.
public
partial
class
Form1 : Form
{
private
BindingList<SampleData> _collectiontempsite1;
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Load(
object
sender, EventArgs e)
{
_collectiontempsite1 =
new
BindingList<SampleData>();
radChartView1.ShowTitle =
true
;
radChartView1.Title =
"Sample"
;
ClearChart();
DrawChart();
}
private
void
ClearChart()
{
radChartView1.Series.Clear();
radChartView1.Axes.Clear();
}
private
void
DrawChart()
{
CategoricalAxis horizontalAxis =
new
CategoricalAxis();
horizontalAxis.PlotMode = AxisPlotMode.OnTicksPadded;
// horizontalAxis.LabelFitMode = AxisLabelFitMode.Rotate;
// horizontalAxis.LabelRotationAngle = 270;
horizontalAxis.LabelInterval = 10;
LinearAxis verticalAxis =
new
LinearAxis();
verticalAxis.AxisType = AxisType.Second;
verticalAxis.LabelInterval = 2;
CartesianSeries series1 =
null
;
series1 =
new
LineSeries();
series1.LegendTitle =
"site1"
;
series1.PointSize =
new
SizeF(5, 5);
series1.HorizontalAxis = horizontalAxis;
series1.VerticalAxis = verticalAxis;
series1.BorderWidth = 2;
series1.CategoryMember =
"Time"
;
series1.ValueMember =
"Temp"
;
series1.DataSource = _collectiontempsite1;
//series1.ShowLabels = true;
series1.CombineMode = ChartSeriesCombineMode.None;
radChartView1.Series.Add(series1);
radChartView1.Area.View.Palette = KnownPalette.Summer;
radChartView1.VerticalScroll.Enabled =
true
;
radChartView1.VerticalScroll.Visible =
true
;
radChartView1.HorizontalScroll.Enabled =
true
;
radChartView1.HorizontalScroll.Visible =
true
;
}
private
void
button1_Click(
object
sender, EventArgs e)
{
Random r =
new
Random(DateTime.Now.Millisecond);
string
strCurrentTime = DateTime.Now.ToString(
"hh:mm:ss:ffff"
);
double
dTemp = Convert.ToDouble(r.Next(70, 120));
_collectiontempsite1.Add(
new
SampleData(strCurrentTime, dTemp));
}
}
Please respond to what I concern. Thank you.