I have a graph showing dates on 1 day intervals on the X-axis. This works fine, however, the tick labels tend to overlap each other and make it look like a mess.
By default, the major tick interval is set to one day. I would like it to scale with the rest of the graph, i.e. when I scale back enough, the major tick interval would be set to one week, one month, etc.
How would I go on implementing this one?
There's no way yet to do this automatically. The best solution would be to use a plot space delegate to monitor changes to the plot space range and adjust the labeling as needed based on the current range.
Related
Goal
I want to display data into a chart control. Like so:
Current Problem
My issue is the data (blue line) goes out of the chart. As seen above, it seems as if my data exceeds the viewing pane... I'd like to be able to view the whole thing.
Is it possible to create some sort of padding? Keep in mind, not all values will be in percentage...
The solution I used is multiplying the YAxis maximum by 5%.
This creates a small padding over my maximum values which enables me to view it correctly. Not very elegant but it does the job for now.
Perhaps there are better answers but this worked great.
I have a time series data being plotted with Highstock API, as a scatter. When I am plotting it for a period of 5 days or more... my scatter points generated in very close proximity are getting totally overlapped. I have to close in my time frame to see that there are actually two points close by(which were overlapping).
so please help me on how i can improve display on this issue.
From what I've read and observed, this is one of the reasons to use a scatter plot: to see where data sets overlap, group together, and to show possible correlation (see the formal definition over at Wikipedia: https://en.wikipedia.org/wiki/Scatter_plot).
You may wish to add a note to the chart that encourages your users to zoom in to see more detail. The zoom function is a native part of Highcharts/Highstock, but isn't immediately obvious to many users.
It's worth noting that you can limit the zoom to either one axis (zoomType: 'x') or both axes (zoomType: 'xy'); see http://api.highcharts.com/highcharts#chart.zoomType. That may offer you a bit more control over how you want your users to view the parts of the chart with a larger number of overlapping points.
How may I get a Line-style DataVisualization.Charting.Chart holding many points to render only the points that have been added since the last render, in order to decrease the refresh time?
I have a real-time line Chart showing a plot of measurement values Yn against time X. On adding the first few points rendering is effectively instant, but on adding the thousandth point it is unacceptably slow (~0.5s on this 3.5GHz P4). I need fast refresh on up to 10,000 points. FastLine style is about 10x faster than Line style, but the charts requirement for markers makes this not an option.
Thanks.
I need to have multiple time frame on a zedgraph. I have to display the stock data on a daily time frame and then if user wishes to view the view in monthly time frame or hourly time frame i need to support it. Note that the data must be in candle stick bar and not the line bar.
Currently i have 3 curves and i display only one at a time and hide the others. For example initially i set up my graph to be on daily time frame and hide the hour and monthly time frame candle stick curve. When the user gives the command to see the hourly graph i hide the daily candle stick and show the hourly time graph. However i am not able to change the x axis as it still shows the daily time instead of changing to hourly. I need to do something to change the x axis time frame from daily to hourly.
Any kind of help is appreciable. Please advise even if there is a workaround. Thanks.
You probably can do it by changing Min, Max and Step properties of XAxis.Scale object.
So, your method/event handler that supports this user action should:
- show/hide proper curves at pane, change
- adjust the scale using properties I listed above
- refresh the graph.
Note, that Refresh() method of ZedGraphControl isn't cheap. It redraws all elements on your graph, so if you have a lot of data, it isn't good idea to use it.
In that situation you should use combination of AxisChange() and Invalidate() methods. It should be faster and cheaper.
Hey guys, and thanks for looking. I have built the simple D2D app from MSDN, available here. Now, I want to draw some primitives and add an fps counter.
I have an OnRender() event, where I draw the rectangles and so on. I also have a call to RenderTextInfo() where I call RenderTarget->DrawText. Where do I add the logic for counting the number of frames per second?
Thanks much.
I don't know the exact Direct2D stuff, but this might help.
Basically, you have two choices. Either you update the framerate when you draw a frame, or each second (or any other time interval).
If you count it when you draw a frame, you can simply get the current time when you draw a frame, and subtract from it the time you drew the last frame. That gets you the time spent drawing this frame. The reciprocal of that (i.e. 1/x) is the framerate.
If you count it at a regular time interval, you need to have some event firing at every interval that checks how many frames were drawn since the last time that event fired. Divide that by your interval (if it's one second, you don't need to divide, of course) and that's your fps count. Don't forget to increment some counter every time you draw a frame.