How do I Change Plot with own Y-Range on Demand? - core-plot

Scenario:
1) Three plots: One 'datum' plot (default) and three comparison plots; each with their own Y Ranges.
The user could choose either:
2a) One stand-alone'datum' plot (default) or...
2b) A combo of {datum & 1 comparison plot}: 2 plots sharing a combined range (max/min Y of both).
All three plots are initially created/graph.
They are to be toggled to displayed per their ranges on demand.
Problem: Changing the graph's Y-Range appears to have an unfavorable (or no) effect: sometimes using the wrong Y-Range (e.g., the combo comparison plots is still using the default datum y-range).
Question: What is the best way to change the graph's Y-Range per demand to accommodate the plot scenarios?
Note: I've been toggling the plots via add/remove plot from graph. Essentially, I just re-assign the new Y-Range/graph when I add the new plot(s).

The plot(s) should change to reflect the new xRange or yRange whenever you change them. If you're modifying the existing range, remember that plot ranges are immutable. You need to make a mutable copy of the existing range before modifying it and assigning the new range to the plot space.

Related

Vaadin heatmap does not support 40x40 (1600) points?

In Vaadin 14.6.1, I tried to create a Vaadin heatmap foollowing the documentation / example from here.
However, I encountered a few problems/questions, listed in descending order of importance below:
The heatmap supported 30 rows by 30 columns; but when I tried 40 rows by 40 columns, the entire heatmap showed a single color (blue in my case).
Is it possible to manually set the minimum numeric value and maximum numeric value for the color scheme. This way, if I plot my data one day and it has values in the range of 0 to 1, but on another dataset from another day, the numeric values range from between 0 and 0.5, the color scheme range won't automatically change (to being between 0 and 0.5) and confuse the user.
In the documentation, it has the following methods listed, but they do not seem to exist in Vaadin 14.6.1
plotOptions.setBorderColor(SolidColor.WHITE);
plotOptions.setBorderWidth(2);
When I hover over the datapoints, is there a way that the tooltip can only show the numeric value (and not the x, y coordinate or the series name etc.?)
Is there any limit to the number of datapoints? I'm hoping that if #1 above is resolved that I can plot a 100 by 100 (ie 10,000) point heatmap.
If I plot 100by100, there will be many labels on the x and y axis. In my case, the x and y axis are actually numerical, so I did what the documentation suggested and just placed category labels in the xaxis and yaxis spots. However, is there any way to only display every "nth" label, so that the x-axis and y-axis is not so crowded? (This would essentially mimic what Vaadin does for normal line charts' xaxis and yaxis).
I'm not that experienced with Vaadin Chart, but these are the questions that I can comment on:
(1) With 40x40 items you go over the threshold of 1000 in which the Chart switches into "turbo" mode for performance reasons. This seems to not be compatible with the heatmap series. You can disable turbo mode by setting plotOptions.setTurboThreshold(0);
(2) Unfortunately the ColorAxis doesn't support this, it only has an API for min and max color. Definitely a valid use-case though, and it seems to be supported by the Highcharts library that the Vaadin Chart uses under the hood. You should consider opening a feature request for this in the Github repo.
(3) This seems to be a documentation issue. The methods are available in later Vaadin platform versions, but not in 14.6.
(5) In theory not, but in practice there will be a huge performance hit in the browser due to the excessive amount of DOM elements (quick test of 100x100 froze the browser for 10s). I'm afraid the component isn't really made for such extreme use-cases. In this case it might be better to utilize a low-level JS drawing library using the canvas, or draw an image on the server-side and display that in the browser. Maybe you can also consider modifying your use-case so that you only display one slice of your data and allow the user to switch between slices.

Box plot legend

I am using box plot to visualise some data, and I want to add some information in graph like this boxplot-with-legend. Does anyone know how can I add this in SPSS?
I'm afraid this isn't really feasible. BTW, in SPSS Statistics box plots, as with Tukey's original versions, the whiskers don't span from min to max, but the smallest to the largest cases that are outside the box but still inside the two "fences". The fences are set at 1.5 IQRs below and above the box edges.

Can I use different colors based on the monotonicity of the values in a Highstock chart?

I have a basic line graph. I want this line to be green when the values are increasing (i.e., current>previous) and red when they are decreasing. Is it possible?
I am aware of this workaround: instead of the original values, I will show the difference between current value and the previous value. This way, if in the new graph I have something greater than 0, it means the original graph is ascending. And I am able to show different colors based on a threshold (so, in the new graph, when value>0, I will use green, and I will know that part of the graph corresponds to an increasing area in the original graph). I am interested in a resolution for the original problem, though.

Highcharts :: Need to split y-axis from primary body of chart. Can I display this axis separately from the Highchart?

I have a situation where I need to remove all margins from a highchart and remove the x/y axis so it fills a series of columns in a table completely.
I did that, no problem. Chart goes to the extremes as needed.
What I need now is that pesky yaxis I already removed...but displayed in a table cell outside of the existing highcharts object.
It would seem easy, as though I could just set the overflow property of yaxis to 'visible' and play with the offset...which would work however this would only work if I wanted to re-position the axis within the boundaries of the highchart object. I want him in a different cell entirely.
Is there anyone who has had experience in this situation? Is it going to require me to have a secondary highchart with only a y-axis?
Best answer gets a green check.
EDIT :: I now have dispersed each 'day' into their own column (more bars coming per day [scheduled,actual,etc...]). In order to keep the scales lined up, I manipulate the yAxis:max property and set them all to a derived value.
In the open column (currently w/ text Hourly Trends) is where I would put an additional highchart module with no series data but with the same min/max/tickInterval.
The next big leap will be to see the data is alive and changes w/ schedule. May have to start another thread for that one, no?
Create a new HC object with no data but only the yAxis (making sure it is the right scale, etc). Perhaps add the same series of data to it but hide the series? Add it to the location you want. This seems kludge and not very good practice. Each business use is different but why would you want this?
EDIT based on comment of business rules:
Why not come at this from a different direction and have the individual chart elements (the bars/points/etc) be a single point chart. This way you have one chart per column. You can then set up the yAxis to be text and not worry about the position. If we could see an example of the page layout and the desired result that would help.

How to Set Plot Position in Core Plot

I need to draw multiple plots. How can I set the position of each plot in codes instead of setting one by one in storyboard?
The image I want to achieve is here. In this image, each small curve is a plot. So there are in total 20 x 15 small plots. I need to position and feed different data for each of them. But I don't want to set their positions one by one coz it's tedious.
Do you need to allow user interaction or frequently update the plots? If not, your best bet is to use one graph with a single plot. Render it into small images, once for each plot, changing the data each time. Draw the images into a view laid out in your grid.
If you can't use the image approach, you'll probably run out of memory long before setting up 300 individual graphs. Instead, use one graph with a single plot space if possible. Offset and scale the data values for each plot so they appear in the appropriate section. Use as few plots as you can (one for each line style). Separate the line segments with empty (NAN or nil) data values.

Resources