Incorrect bar width with TChartScrollBar
Posted: Tue Nov 29, 2016 2:36 pm
Hello
I have set up the following code.
When my series is composed of 5 values (FillSampleValues (5)), I get this...
When my series is composed of 100 values (FillSampleValues (100)), I get this...
Since Chart1-> LeftAxis-> Maximum is always 5, I would like that in both cases, my bars have the same width.
In my example, with 100 values, the bars are very small whereas there is ample room to display them. He pretends to put all the bars on a single page.
What should be done ?
I have set up the following code.
Code: Select all
TChart * Chart1 = new TChart(this);
TChartScrollBar *scrollBar = NULL;
Chart1->Parent = this;
Chart1->Align = alClient;
Chart1->AddSeries(new THorizBarSeries(Chart1))->FillSampleValues(20);
Chart1->LeftAxis->Minimum = 0;
Chart1->LeftAxis->Maximum = 5;
Chart1->LeftAxis->Automatic = false;
scrollBar = new TChartScrollBar(this);
scrollBar->Parent = this;
scrollBar->Align = alRight;
scrollBar->Kind = sbVertical;
scrollBar->Width = 17;
scrollBar->Min = 0;
scrollBar->Max = 100;
scrollBar->Chart = Chart1;
scrollBar->RecalcPosition();
In my example, with 100 values, the bars are very small whereas there is ample room to display them. He pretends to put all the bars on a single page.
What should be done ?