Git Product home page Git Product logo

mschartextension's Introduction

mschartextension's People

Contributors

code-artist avatar pckujawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mschartextension's Issues

Request: Keep context menu open when (de)selecting series

If a chart has a number of series in it, it's inconvenient to constantly r-click and disable/enable the series of interest. I propose keeping the menu open when any of the series items are clicked.

I took a look and tried a few things in the code but, due to the way the metadata (e.g. the chart's series) is being associated with the menu items, it isn't as simple as setting AutoClose to false or attaching to the Closing event and canceling it. These both serve to keep the menu open, but the checkbox values don't change and, on the second click of any item, a number of null reference exceptions happen.

Here's some useful code that I started from: http://stackoverflow.com/questions/3429487/contextmenu-will-not-stay-open-c-sharp-net-4-0-client-profile-winforms

Change: methods to add annotations (e.g. DrawLine) should return Annotation object

As a dev
I want to get the Annotation I've just added using the DrawXXX methods
So that I can store it for later removal, use it in a lookup, change its properties, etc

Example:

var xLoc = 1.0;
Annotation justAdded = chart.DrawVerticalLine(xLoc, Color.Blue);
justAdded.Visible = false;
vertLineAnnotations.Add(justAdded);
lineLookup.Add(xLoc, justAdded);
...

Request: Pan should allow dragging beyond bounds of chart

It makes sense to constrain the extent of selection to within the chart when zooming, but when panning it's just an inconvenience for the user.

As a user,
When in Pan mode after having Zoomed in
I want to click anywhere on the chart and drag to anywhere on my screen
And see the chart panning
So that I don't have to click and drag within the chart a bunch of times

Request: Zoom a range only along X axis

I'm still working on some of the other issues, but one feature has become a priority and that is to be able to zoom only in X.

As a user,
I want to click and drag anywhere on the chart
And see a selection box which fills the height of the chart and goes from the left side of where I clicked to the right side of where the mouse is moving (or vice-versa)
And when I release the mouse the chart is zoomed to that range
So that I can see my data at higher resolution

As a dev,
I want to know when the user has changed the window of data viewed (zoomed)
And know what the new extents (top, left, bottom, right) are in units matching those of the data
So that I can perform statistics on only the visible data

To address these two stories, I propose:

  • A context menu item "Zoom X"
  • A ZoomChanged event or callback
    ** Its argument would be a Rectangle whose extents are in the units of the data (i.e. not in pixels or percentage etc)
    ** It would be raised not only on Zoom X but on normal Zoom too

How does that sound? In regards to the current method of passing in callbacks to the constructor, is that being done because there isn't a way to extend the Chart object with new events, or was it just a preference for callbacks instead of events? I'm use to using events, but I'd like to know what considerations were made when you decided to use callbacks instead.

Thanks!
Pat

Error during minimizing

I have attached the plot on a form and during a minimizing in the a cursor is present on the plot the application crash.
The error is the followng:

at System.Windows.Forms.DataVisualization.Charting.Axis.PositionToValue(Double position, Boolean validateInput)
at System.Windows.Forms.DataVisualization.Charting.Axis.PixelPositionToValue(Double position)
at System.Windows.Forms.DataVisualization.Charting.MSChartExtension.CheckAndUpdateTextAnnotationLocation(Chart chart, TextAnnotation textAnn, Double xStart, Double yStart)
at System.Windows.Forms.DataVisualization.Charting.MSChartExtension.UpdateCursorLabelPosition(Chart sender)
at System.Windows.Forms.DataVisualization.Charting.MSChartExtension.ChartControl_Resized(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Request: Scroll wheel zoom

I see that a separate branch has been created to add zooming with the mouse wheel. I for one would like to see that functionality completed.

Real-time displaying data points?

Hi,
Can MSChartExtension support displaying data in real-time? Can we feed 1000 data points for every 100ms?
A max of 1000 data points in the chart can be display at at time.

Can it support displaying more than 1 series of data?

Thanks

Ideas: Callback for PanFinished and new architecture to facilitate changes

Along the lines of some of the work done with ZoomChanged, wherein the client's callback receives the extents of the visible data, I was thinking that a callback once the user has stopped panning would be in order.

A scenario would be that the client wants to update statistics (say mean, standard deviation, min/max, etc) on the visible data. Currently, she or he can use the ZoomChanged callback to receive this information any time the chart is zoomed. But if the user pans, we have no mechanism in place (unless I'm missing something) to ensure that the client is notified that the visible extents of the chart have changed. Now, one option is for the client to just wire up a button saying "Recalculate Statistics," but I think an event or callback would result in a more user-friendly interface.

Lastly, in order to facilitate this and future changes, it might be wise to return a ChartController object from the EnableZoomAndPanControls() method. Then we could use that object to subscribe to events, enable/disable context menu items, and maybe more. I haven't thought it through too much, but I feel that this method would make it easier to introduce new features without breaking backwards-compatibility (and without adding too many parameters to the extension method).

Anyway, just some ideas to discuss, so please leave feedback.
Thanks,
Pat

Change: Select should create a selection area (like zoom)

I've already implemented the code, but I figured that I would start a discussion. Maybe there's a good reason why selection should only be one point and I'm not thinking of it.

The way I implemented it, the callback is made on the MouseUp event rather than MouseDown (the previous method). This way, the callback (whose signature now just sends a RectangleF) is called only once with the complete selection area information. This may break existing code that relied on SelectionChanged being called on MouseDown, but I doubt it.

To supplement this new selection style, I wrote a method that returns the DataPoints within the selected area, which is clearly a useful thing.

Crash with .NET 4.7.2

My .NET 4.7.2 C# program crashes when I select "Clear Cursors" with v3.2.0. I tried version 2.1.0 and that crashes when you drag a rectangle to zoom in. It's fine with v1.4.1.

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.