Hi
I'm trying to create a timeline chart to represent the on/off time of say 50 machines. Machine A turns on from the 2nd hour to 10th hour, and then from 15th hour to 23rd hour. Machine B turns on from 0 hour to 8th hour, and then from 10th hour to 15th hour. And so on.
Is the bar chart able to achieve my objective? How do i go about doing it?
If the bar chart is not suitable, what should i use?
Thank you.
Creation of timeline chart
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Creation of timeline chart
I'd suggest using LineCollections. One LineCollection for A, one for B. Line collection can have many lines. Each line collection can be colored with specific color, like red for A and blue for B.
LineCollection consists of SegmentLines, and each of them has two position: start and end point.
LineCollection consists of SegmentLines, and each of them has two position: start and end point.
LightningChart Support Team, PT
Re: Creation of timeline chart
Hi Parsi,
I have implemented using line collections as you suggested for what i require. With that is mind, is there any way for me to achieve as shown in the attachment, where 1 line is a solid line (grey line) while the other line only have outlines (red lines), using line collections?
Please advise.
I have implemented using line collections as you suggested for what i require. With that is mind, is there any way for me to achieve as shown in the attachment, where 1 line is a solid line (grey line) while the other line only have outlines (red lines), using line collections?
Please advise.
- Attachments
-
- graph.png (10.36 KiB) Viewed 8860 times
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Creation of timeline chart
It should be possible but may prove out very difficult to align the red lines accurately in the edge of the gray bars. Series values are follow axis values. Use YAxis.ValueToCoord to get the Y center coordinate of the gray bar, say that's yGC.
Top of gray bar is then yGT = yGC - grayLineCollection.LineStyle.Width / 2.
Gray bar bottom is yGB = yGC + grayLineCollection.LineStyle.Width / 2
Then let's determine the red line center Y screen coordinates.
yRT = yGT - redLineCollection.LineStyle.Width / 2.
yRB = yGB + redLineCollection.LineStyle.Width / 2.
Use yAxis.CoordToValue to convert yRT and yRB in axis values, and set the red line collection's SegmentLine points based on the result.
Something like that perhaps.
Top of gray bar is then yGT = yGC - grayLineCollection.LineStyle.Width / 2.
Gray bar bottom is yGB = yGC + grayLineCollection.LineStyle.Width / 2
Then let's determine the red line center Y screen coordinates.
yRT = yGT - redLineCollection.LineStyle.Width / 2.
yRB = yGB + redLineCollection.LineStyle.Width / 2.
Use yAxis.CoordToValue to convert yRT and yRB in axis values, and set the red line collection's SegmentLine points based on the result.
Something like that perhaps.
LightningChart Support Team, PT