# Create Parallel Coordinates Chart

**URL:** <https://discourse.slicer.org/t/create-parallel-coordinates-chart/27995>\
**Category:** Support\
**Created:** [February 22, 2023, 10:30pm UTC](https://discourse.slicer.org/t/create-parallel-coordinates-chart/27995 "2023-02-22T22:30:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyridon97](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/spyridon97/32/18517_2.png) [@spyridon97](https://discourse.slicer.org/u/spyridon97)\
**Post date:** [February 22, 2023, 10:30pm UTC](https://discourse.slicer.org/t/create-parallel-coordinates-chart/27995/1 "2023-02-22T22:30:38Z")

</div>

Hello!

I would like to know how i can create Parallel Coordinates chat?

i have some paths that have various metrics and for each metrics i save the min.max in a column of a table, which i connect to a vtkMRMLTableNode.

What do i need to do afterwards to create a Parallel Coordinates Chart?

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [February 22, 2023, 11:36pm UTC](https://discourse.slicer.org/t/create-parallel-coordinates-chart/27995/2 "2023-02-22T23:36:51Z")

</div>

The plot type currently supported in the [Plots module](https://slicer.readthedocs.io/en/latest/user_guide/modules/plots.html) are:

- `line`
- `bar`
- `scatter`
- `scatter-bar`

It could be extended to also include `parallel-coordinates` by leveraging the `vtkPlotParallelCoordinates` VTK class.

If you would like to help improve the code base, we can provide additional guidance.

As a starting point, you could look at [qMRMLPlotViewPrivate::updatePlotFromPlotSeriesNode](https://github.com/Slicer/Slicer/blob/4f3d97c612b417cb8fe1c5688910f71d23a35852/Libs/MRML/Widgets/qMRMLPlotView.cxx#L238)

References:

- [https://vtk.org/doc/nightly/html/classvtkPlotParallelCoordinates.html](https://vtk.org/doc/nightly/html/classvtkPlotParallelCoordinates.html)
- [https://kitware.github.io/vtk-examples/site/Cxx/Plotting/ParallelCoordinates/](https://kitware.github.io/vtk-examples/site/Cxx/Plotting/ParallelCoordinates/)

---

<div class="post-metadata">

**Author:** ![spyridon97](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/spyridon97/32/18517_2.png) [@spyridon97](https://discourse.slicer.org/u/spyridon97)\
**Post date:** [March 6, 2023, 9:29pm UTC](https://discourse.slicer.org/t/create-parallel-coordinates-chart/27995/3 "2023-03-06T21:29:44Z")

</div>

Thanks for the answer @jcfr. I will work on it an submit a PR on Slicer’s Github.

---

<div class="post-metadata">

**Author:** ![spyridon97](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/spyridon97/32/18517_2.png) [@spyridon97](https://discourse.slicer.org/u/spyridon97)\
**Post date:** [March 6, 2023, 11:09pm UTC](https://discourse.slicer.org/t/create-parallel-coordinates-chart/27995/4 "2023-03-06T23:09:13Z")

</div>

@jcfr @lassoan

Could i change the API of the following in the ctk library?

```auto
class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKChartView : public ctkVTKOpenGLNativeWidget
{
  Q_INVOKABLE vtkChartXY* chart()const;

```

chart() to return a vtkChart object instead of vtkChartXY?  
I wanna do that because i need vtkChartParallelCoordinates instead of vtkChartXY.  
Also this will enable us to be able to add other subclasses of vtkChart such as, vtkChartBox, vtkChartPie. vtkHistogram2D.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 9, 2023, 5:55am UTC](https://discourse.slicer.org/t/create-parallel-coordinates-chart/27995/5 "2023-03-09T05:55:42Z")

</div>

Adding support for more chart types would be great!

Adding an API to get/set vtkChart\* is certainly necessary for this, but simply changing the return type would be a breaking change (could cause compilation errors) that would be nice to avoid. For example we could simply add a new method (`abstractChart()`, `generalChart()`, …).

We would need to see all the necessary API changes for making a final decision on whether we should make any breaking changes.
