I should create a chart where the values of the last 24 hours are displayed, the data will be taken from the database, each value has an associated datetime, based on the time of the datetime will be inserted in the time zone defined in the chart.
What kind of chart should I use?
Is it possible to do this with a linear chart ?
I’m creating the graph entirely from code, with console application.
I have created a dictionary containing the datetime and the values to insert in the chart.
For the example:
Hour Value
00:02 1234
00:05 1424
00:10 432
00:10 356
00:45 1356
01:30 1674
01:55 512
02:20 2674
03:40 3456
04:30 2567
05:40 5678,89
06:20 2456
07:10 1289
07:50 879
08:35 568
09:45 868
10:35 765
12:35 2765
13:35 2123
Is it possible to show only hours such as “01:00”, “02:00”, “03:00” instead of the exact time as 01:30, 01:55, 02:03?
And enter the values according to the time slot.
After you set those cells to DateTime values (not to String values), you should get the horizontal axis as the value axis. In that case, you’ll be able to use this:
Sorry mario, i was wrong.
At the end of the code I convert the file to .pdf with:
workbook.Save(path, GemBox.Spreadsheet.PdfSaveOptions.PdfDefault)
and give me that image chart above.
If I download it with format . xlsx I get this which is correct.
As a future reference, the problem occurs because the older version of GemBox.Spreadsheet is being used. The newer versions will render that horizontal axis appropriately.
Also, another thing to note here is that in order to create a full 24-cycle on a horizontal axis, you need to use this: