Coder Social home page Coder Social logo

mschartwrapper's Introduction

MSChartWrapper: A Wrapper Around Microsoft Chart Control for Win32

This repository contains a component library and a sample UI application for MSChartWrapper. If you wish to create a simple line-chart or column-chart but do not want to dive into the API for Microsoft Chart Control, this is for you.

In terms of UI, it adds a side-legend with check-boxes, so that you can choose what series to show and what series to hide. It also adds a context menu to the chart area so that one can easily show or hide chart legends, and save the plot to an image file. It also supports saving a plot to a Matlab .m file.

It may not be too much at the UI side, but at the API side one can easily plot a series with a few function calls:

// retrieve the series values from somewhere
double[] ser1 = GetFirstSeriesValues();
double[] ser2 = GetSecondSeriesValues();
// now plot them
chartWrapperObj.AddLinePlot("First Series", ser1);
chartWrapperObj.AddLinePlot("Second Series", ser2);

This is it. If you want to add markers to the series you have to set a few properties in advance. For example if you want to show 10 markers along the whole line (with equal distances) do the following:

chartWrapperObj.AddMarkers = true; // it is by default true though
chartWrapperObj.MarkerCount = 10;

Or if you want to show a marker after every 200 data points do the following instead:

chartWrapperObj.AddMarkers = true;
chartWrapperObj.MarkerFreq = 200;

Anyway if you miss the underlying chart control, you can have a reference to it and perform your own customizations:

var msChart = chartWrapperObj.TheChart;

Even easier, if you want to show a chart in a separate window, just as easy as you pop a MessageBox, try the static methods of the ChartForm class. For example, showing a chart window with two line series (say ser1, and ser2) is as easy as the following method call:

ChartForm.ShowLineChartForm(
	new[] { "Firs Series", "Second Series" }, new[] { ser1, ser2 }, 
	"Comparing the series", "x", "value", "Line Chart Window Demo");

Nuget

Along with its Github page, you can also install MSChartWrapper through Nuget:

Install-Package MSChartWrapper 

Screenshots

A simple line chart:

A simple line chart

A simple column chart:

A simple column chart

Highlighting the UI features:

Highlighting the features

License

MIT

mschartwrapper's People

Contributors

sinairv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.