2

I am using LineChart from the Google Charts API and I want to plot two sets of data - one is observations and one is model outputs. The problem is that the model outputs are regular in time (hourly), but the observations can be sporadic and are not usually aligned with the model times.

I can't store them both as columns in one DataTable, as they are not temporally collocated, so I need 2 data tables, but I can't get LineChart to accept more than one data table!

Is there a way around this?

TIA.

2 Answers 2

3

The best way to do this would be to combine the DataFrames and leaves NULLs where the values are not defined. In your case, each row would end up having one defined value one null value.

Then when you plot, set interpolateNulls to True and it will connect the points through the NULLs which should give you the functionality you want.

Sign up to request clarification or add additional context in comments.

Comments

2

First, you do have to get your data into one DataTable. There is no way to create a chart from more than one DataTable or DataView, or create a DataView from more than one DataTable (though there has been a request for this). How you get the data into one DataTable is up to you. It doesn't look like any of the data manipulation methods will help.

The good news is, once you have all the data in one DataTable, you can plot it even if the data sets are not aligned at the same time values. Just specify multiple domain columns using data roles. Search for "multi-domain" on that page to find an example.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.