Comments (4)
Please refer to here:
https://github.com/Blake-Madden/Wisteria-Dataviz/blob/main/BuildingData.md
Does this help?
from wisteria-dataviz.
Please refer to here:
https://github.com/Blake-Madden/Wisteria-Dataviz/blob/main/BuildingData.md
Does this help?
No... That's the guide I followed initially before putting my project aside to try and understand how the demo works. Look, this is what I have so far. Where did I screw up?
double *data = ... data points ...
time_t *times = ... timestamps ...
auto yData = make_shared<Data::Dataset>();
yData->AddContinuousColumn(L"AVG_GRADE");
yData->AddCategoricalColumn(L"WEEK_NAME");
for (int p = 0; p < size; p++)
yData->AddRow(Data::RowInfo().Continuous({ data[p] }).Categoricals({ 0 }));
for (int p = 0; p < size; p++)
yData->AddRow(Data::RowInfo().Dates({ wxDateTime(times[p]) }));
// set the string labels for the codes in the grouping column
yData->GetCategoricalColumn(L"WEEK_NAME")->GetStringTable() =
{ { 0, L"Week" } };
Canvas *canvas = new Canvas(m_panel1, wxID_ANY, wxDefaultPosition, m_panel1->GetSize(), wxALL | wxEXPAND);
auto linePlot = std::make_shared<Graphs::LinePlot>(canvas,
// use a different color scheme
std::make_shared<Colors::Schemes::Decade1960s>(),
// or create your own scheme
// std::make_shared<Colors::Schemes::ColorScheme>
// (Colors::Schemes::ColorScheme{
// ColorBrewer::GetColor(Colors::Color::Auburn),
// ColorBrewer::GetColor(Colors::Color::OctoberMist) }),
// turn off markers by using a shape scheme filled with blank icons
// (having just one icon in this scheme will get recycled for each line)
std::make_shared<Icons::Schemes::IconScheme>(Icons::Schemes::IconScheme{ Icons::IconShape::Blank }));
// add padding around the plot
linePlot->SetCanvasMargins(5, 5, 5, 5);
// Set the data and use the grouping column from the dataset to create separate lines.
// Also, use a categorical column for the X axis.
linePlot->SetData(linePlotData, L"AVG_GRADE", L"WEEK_NAME");
// add some titles
linePlot->GetTitle().SetText(_(L"Average Grades"));
linePlot->GetSubtitle().SetText(_(L"Average grades taken from\n"
"last 5 weeks' spelling tests."));
linePlot->GetCaption().SetText(_(L"Note: not all grades have been\n"
"entered yet for last week."));
// remove default titles
linePlot->GetBottomXAxis().GetTitle().SetText(L"");
linePlot->GetLeftYAxis().GetTitle().SetText(L"");
// add the line plot and its legend to the canvas
canvas->SetFixedObject(0, 0, linePlot);
canvas->SetFixedObject(0, 1,
linePlot->CreateLegend(
Graphs::LegendOptions().
IncludeHeader(true).
PlacementHint(LegendCanvasPlacementHint::RightOfGraph)) );
This code throws an exception about the Y column not existing.
from wisteria-dataviz.
You should combine the loops into one like this:
for (int p = 0; p < size; p++)
yData->AddRow(Data::RowInfo().Continuous({ data[p] }).Categoricals({ 0 }).Dates({ wxDateTime(times[p]) }));
You need to fill a row in one call.
That's at least part of the problem, I'll look into this further this evening.
from wisteria-dataviz.
You are not passing the dataset that you filled with data to the line plot. You're passing the wrong dataset. The dataset being filled from your arrays is yData
, but here is what you are sending to the graph:
linePlot->SetData(linePlotData, L"AVG_GRADE", L"WEEK_NAME");
Try passing yData
instead of linePlotData
.
from wisteria-dataviz.
Related Issues (20)
- Compile fail on windows 10 + MSYS2 + ninja.exe HOT 18
- Sidebar has major flickering issue HOT 1
- Wordcloud feature
- Exporting as image with customized size clips image
- I hope this library could be part of msys2's library HOT 1
- How do you draw the pie chart? HOT 5
- Sankey diagram needed
- Import needs to support multiple MD values
- Sankey improvements
- Screenshot dynamic IDs need to work for text window and list control functions also
- Suffix isn't being added to columns when pivoting wider HOT 1
- JSON syntax: variable names should allow embedded constants
- Need better app icon
- Ability to apply different label displays for each column
- Word cloud: add option to limit cloud to x number of words
- 403 forbidden error when connecting to this page
- Add pivoting example to the demo
- Need a "thicker" option for watercolor bar/box effect
- Any feature about two Y axies in the chart? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wisteria-dataviz.