Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

ScatterDraw Demo

 

Scatter series without GUI

 

 

ScatterDraw_Demo.cpp

 

#include <ScatterDraw/ScatterDraw.h>

 

using namespace Upp;

 

#include <plugin/png/png.h>

 

 

CONSOLE_APP_MAIN

{

    Cout() << "\nScatterDraw_Demo";

    Cout() << "\nScatter painted to Image and saved to file";

    

    String fileName = AppendFileName(GetDesktopFolder(), "Scatter");

    

    ScatterDraw scatter;

    Vector<Pointf> s1;

    double x[] = {20, 30, 40, 50, 60};

    double y[] = {34, 45, 49, 44, 56};

    

    scatter.SerializeData(true);

    

    bool loaded = false;

    if (FileExists(fileName + ".xml")) {

        LoadFromXMLFile(scatter, fileName + ".xml");

        loaded = true;

    } else if (FileExists(fileName + ".json")) {

        LoadFromJsonFile(scatter, fileName + ".json");

        loaded = true;

    } else if (FileExists(fileName + ".bin")) {

        LoadFromFile(scatter, fileName + ".bin");

        loaded = true;

    }

    

    if (loaded) {

        Cout() << "\nRead scatter from file";

        fileName = fileName + "+";

    } else {

        Cout() << "\nPreparing scatter";

        

        s1 << Pointf(10,14) << Pointf(20,25) << Pointf(30,29) << Pointf(40,24) << Pointf(50,36);

        scatter.AddSeries(s1).Legend("Series 1").NoMark().ERROR: Invalid UTF-8 sequence: ºC`"`,` `"seg`"`)`;&

Do you want to contribute?