# How to add Dates to X-Axis of Line Plot

**URL:** https://discourse.vtk.org/t/how-to-add-dates-to-x-axis-of-line-plot/10466
**Category:** Support
**Tags:** code
**Created:** [January 16, 2023, 10:51am UTC](https://discourse.vtk.org/t/how-to-add-dates-to-x-axis-of-line-plot/10466 "2023-01-16T10:51:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DavidA](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/ba8739/32.png) [@DavidA](https://discourse.vtk.org/u/DavidA)
#### Post date: [January 16, 2023, 10:51am UTC](https://discourse.vtk.org/t/how-to-add-dates-to-x-axis-of-line-plot/10466/1 "2023-01-16T10:51:53Z")

</div>

I followed the examples provided on the [vtk.org](http://vtk.org) website and am able to create line plots, scatter plots, etc. but so far I have only been able to have a running number along the X-Axis. I would like to change the running number to dates.

I tried adding a `vtkNew<vtkStringArray>` to column zero of the table instead of `vtkNew<vtkDoubleArray>` and I also tried using SetLabels() on the chart but nothing works.

Can someone give me some pointers on how to change the X-axis to dates (or anything other than running number - e.g. a string)?

Is there another place to find example code other than the [vtk.org](http://vtk.org) website? The examples are not very comprehensive and the documentation is not great so a better set of examples might help.

I code in C++ but if I can see how to do it in any language I would be able to get it to work in C++.

Thanks in advance.
