Platform: Lazarus 1.8.4, TAChart 1.0 (came with this version of Lazarus), Windows Server 2016.
I'm a beginner with TAChart. Can some one be so kind as to tell me how to make a stacked bar chart. I will need minimum of 1 stack, maximum of 3 stacks. The "range" (height) of each stack will be minimum zero, and maximum 1440. Each stack will have many different "bar segments" in it. The stacks may, or may not, reach the 1440 mark. The stacks may have blank "segments" in them. If that's not possible, then I'll just add a segment that is colored the same as the background. For starters, let's draw only one stack, and let's pretend there are 4 segments in this stack, colored Red,Green,Blue and Yellow.
If there is only 1 stack, it can occupy only one third the width of the chart. If there are 3 stacks, they can occupy the entire chart, but with a little space between each stack.
I'll tell you what I know and you can fill in the rest:
- Place TAChart on form, align to client
- Right click, Edit series, choose TBarSeries
- (Not sure to do with Axis, totally lost)
- Place a button on the form and write it's OnClick as:
chtBPMBarSeries1.AddXY(0, 30, 'My Label', clRed);
chtBPMBarSeries1.AddXY(0, 70, 'My Label', clGreen);
chtBPMBarSeries1.AddXY(0, 40, 'My Label', clBlue);
chtBPMBarSeries1.AddXY(0, 90, 'My Label', clYellow);
The above code doesn't do anything. This is where I am stuck.
Thanks in advance for any help you can provide.