Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scatter plot to show Time on X-axis and option to remove slider #106

Closed
xxeasterxx opened this issue Jun 5, 2019 · 6 comments
Closed

Scatter plot to show Time on X-axis and option to remove slider #106

xxeasterxx opened this issue Jun 5, 2019 · 6 comments

Comments

@xxeasterxx
Copy link

xxeasterxx commented Jun 5, 2019

For scatter plot, the chart shows a slider at bottom of the chart which one need to slide it to show data points at that certain minute (e.g. bucketSize: 1 minute, i had to slide the slider to show data point at each minute). Is it a temporary solution? Isn't there a way to show all data points without the slider? More specifically, the spMeasures X-Axis should be the time.

@xxeasterxx xxeasterxx changed the title Scatter plot to show Time on Y-axis and option to remove slider Scatter plot to show Time on X-axis and option to remove slider Jun 5, 2019
@ccrowley96
Copy link
Contributor

Hi! Checkout the scatter plot API reference. You can use the isTemporal chartOption to change the data display from time sliced with a slider to showing all timestamps at once. The scatter plot must plot two values against one another however, with an optional parameter for radius of the points.

@xxeasterxx
Copy link
Author

xxeasterxx commented Jun 5, 2019

Is this available in v1.2.45? I have data which I just need to plot against Y-axis and X-axis being the time. Is it possible for the X-axis to be optional on this case? Is there any examples for scatter plot?

@ccrowley96
Copy link
Contributor

If you're looking to plot data on the Y axis vs time, I'd recommend checking out the line chart! The latest updates in scatter plot are not in NPM yet, but they'll be out soon.

@darsney
Copy link
Contributor

darsney commented Jun 5, 2019

Also, if you are really set on using the x axis for time, you can specify milliseconds of the time you intend to use as a value (using .valueOf()) and plot that on the x axis. If you could share an example of a chart that uses scatterplot and x axis as time that would be cool, I'm curious in the use case

Alternatively you can enable dots and hide the paths of lines using CSS in the line chart, that should give you a similar effect

@xxeasterxx
Copy link
Author

If you're looking to plot data on the Y axis vs time, I'd recommend checking out the line chart! The latest updates in scatter plot are not in NPM yet, but they'll be out soon.

As the data points are quite densed, having line chart makes it look messy.
image

Also, if you are really set on using the x axis for time, you can specify milliseconds of the time you intend to use as a value (using .valueOf()) and plot that on the x axis. If you could share an example of a chart that uses scatterplot and x axis as time that would be cool, I'm curious in the use case

Alternatively you can enable dots and hide the paths of lines using CSS in the line chart, that should give you a similar effect

Above image is a use case, I've 4 values I need to plot against time. If I used line chart and change the line colors to white, and enable the dots for all 4 values, they're all black and cannot customize the color, moreover the legend color too. So I hope that the scatter plot can have out of the box, just plot X-axis as the time.

@darsney
Copy link
Contributor

darsney commented Jun 7, 2019

Hi, here's a minimal example in a single file that does what you are trying to achieve...I'm going to go ahead and close this issue now. Thanks for using the library!

https://codepen.io/darsney/pen/xNvbBQ

@darsney darsney closed this as completed Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants