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

Timeseries Support #23

Open
tdtooke opened this issue Feb 19, 2021 · 2 comments
Open

Timeseries Support #23

tdtooke opened this issue Feb 19, 2021 · 2 comments
Assignees
Labels
feature Feature roadmapped for implementation

Comments

@tdtooke
Copy link

tdtooke commented Feb 19, 2021

First: I love this. I have been searching for a way to have plotly on C++. I'm plotting graphs of temperature against time. Currently I'm doing this in QT with QTCharts and graphing that way you can define an axis as time. Right now my time object, pre-cpplot is a QLineSeries where the QDateTime is converted with toMSecsSinceEpoch() and with my axis definition I get a good visual on the QChart of the time formatted in a way you can understand. I was able to work out from your tutorial how to use VectorXD where I used to use QLineSeries to plot my data but I can't seem to figure out a way to get a proper time axis on X. I do have a python version of my app that does use plotly which has a nice date axis, but on that one the app reads a csv and with pandas I can use parse_dates=(the one that's my time column) and plotly just works without me having to do anything. How do I do this with cpplot? Sorry for the rambling..

@thclark
Copy link
Owner

thclark commented Feb 19, 2021

Hi @tdtooke thanks for opening the issue!

I'd not really considered timeseries before (strange, I do a lot of timeseries work but I guess nothing in c++!).

Can you help me out and create a very minimal python example (just a few datapoints) that'll plot the kind of chart you want? That'd give me a clearer idea of exactly what's needed.

@tdtooke
Copy link
Author

tdtooke commented Feb 22, 2021

Here's a little snippet that'll do a time axis on x with plotly

import pandas as pd
import plotly.graph_objects as plotz

mydata = [['2020-07-07 18:24:26.703', 23.42968], ['2020-07-07 18:27:55.833', 68.20094], ['2020-07-07 18:31:55.823', 1.014660e+02]]
df = pd.DataFrame(mydata, columns=['Time', 'Temp'])
df['Time'] = pd.to_datetime(df['Time'])
fig = plotz.Figure()
fig.add_trace(plotz.Scatter(x = df['Time'], y = df['Temp'], name = "Test"))
fig.write_html("test.html")

@thclark thclark added this to Triage in CPPlot Roadmap via automation May 5, 2021
@thclark thclark moved this from Triage to v0.x in CPPlot Roadmap May 5, 2021
@thclark thclark changed the title Time Support Timeseries Support May 5, 2021
@thclark thclark added the feature Feature roadmapped for implementation label May 5, 2021
@thclark thclark self-assigned this May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature roadmapped for implementation
Projects
Development

No branches or pull requests

2 participants