Perspective XY Chart X-axis value positioning

The values in the x-axis don’t quite coincide with the data. In this example, the shift starts at 5AM (where the dip in the data occurs). I can shift the grid to compensate, but I can’t find a way to shift the grid values.

Before moving the grid:
1

After
2

This is possible in the underlying AMCharts library that Perspective uses, but it isn’t exposed within Perspective and can’t be done as is.

Hi,

That’s strange. The chart should align the data out of the box. It is currently possible to set a start range on a particular axis in addition to shifting the grid over on either axis. Do you mind sharing your config and an example snippet of your data? Feel free to DM me if you’re more comfortable that way.

-Yousuf

Hi Yousuf, (EDIT: Sorry for the misspell, my friend! )

I attached everything i could think of. I removed the binding from the chart in the uploaded view, to keep the existing data, but have a screen shot of the binding setup and an export of the values from the named query

values.csv (201.1 KB)
JC_perpsective_xy_2019-07-25_1140.zip (54.0 KB)

Hi,

Sorry for the delay. I would try returning a date time string instead of a unix timestamp. Currently looks like it does a better job at parsing date time strings than timestamps for some reason.

For the x-axis configuration, set the baseInterval to 1 hour and make sure it’s enabled. Format the date so that it reads hh:mm instead of hh.

For the grid appearance, you can set the minDistance to 15 and adjust the grid position to 0.5 (you might need to adjust these depending on the size of the chart).

I would also recommend rotating the labels 90 degrees (this is located under appearance, available in RC2).

Might be a good idea to enable x trace too by setting cursor.series = eff60.

The XYChart is meant to intelligently adjust the the number of labels based upon the available space. If your chart is static in size, you might be able to adjust the minDistance and position properties to achieve the look you want.

Hopefully that helps.

-Yousuf

Thanks for the reply, Yousuf. I can say that none of that worked for 8.0.2. :smile:

I’ll get RC2 loaded up some time this afternoon and see what happens.

You've probably solved this, given up, or just moved on by now, but in case someone else sees a problem like this like I did today, I changed appearance.labels.horizontalCenter from right to left, and it looked good after that

image

Editor, showing horizontalCenter correctly set to left
image

Before fixing

After Fixing

1 Like