We are using echarts for charting. We have multiple graphs on the page that should be connected on the time axis (meaning if you zoom and scroll on one graph, the other graphs zoom and scroll the same), but not on the value axis. We are currently using the connect function (https://ecomfe.github.io/echarts-doc/public/en/api.html#echarts.connect) for this, but this connects both the time and the value axis.
Is it possible to only connect the time axis?
You're doing it right connecting charts in a group with connect method. But you also have to define how your dataZoom works.
It's possible to control both cartesian axes by the dataZoom-inside. For zooming / sliding just x axis (time axis in your case) try these settings for all the connected graphs:
dataZoom: [{
type: 'inside',
xAxisIndex: 0,
filterMode: 'weakFilter',
}]
In the example xAxisIndex stands for the xAxis index of a chart. If you have a few x axes on a same chart instance and you want all of them to be zoomable - just list their indexes in an array:
xAxisIndex: [0, 1 ,3]
Don't set yAxisIndex if you don't want the value axis to be zoomable.
Here you may find more:
https://echarts.apache.org/en/option.html#dataZoom-inside.xAxisIndex
Hope this helps.
Related
I have a figure containing three instances of a graph plotting class. I want two of them to be able to zoom in/out in both the x and y direction, and one of the instances to be able to zoom in only the x direction. At the moment I can set the graphs to be able to zoom using
zoom(obj.Axes, 'on')
And this allows for zooming in both x and y directions. I want to be able to change the zoom characteristics of one of the graphs using a conditional statement, within the graph plotting class, like this
if strcmp(obj.Type, "Axes3") % obj.Type is a descriptor, set when the instances are created, that I am using to
% differentiate between the graphs, for the other two graphs these would be
% "Axes1" and "Axes2"
zoom(obj.Axes, 'xon');
title(obj.Axes, "Graph 3");
else
zoom(obj.Axes, 'on');
title(obj.Axes, "Other Graphs");
end
However when I implement this all three of the graphs are set to zoom in only the x direction. I think it may be a result of the zoom() function setting the zoom properties for all the graphs in the same figure, not just the one instance. What is confusing me though is that the title function is successfully setting the titles differently for each graph, same goes for xlabel and ylabel which I have left out here but are implemented the same way as title.
Any ideas about how to set the zoom property of each graph independently?
Now vaadin set X axis on min vertical value(bottom) and Y axis on min horizontal value (left), but i will like set axes on middle
I'm afraid that axis are always in left and bottom of the plot area.
One thing you can do is set the min at negative, or leave it automatic, and add a plotline with value 0 for both axes. That way you can visualize the chart's quadrants.
If you're using java API you can use addPlotLine method in xAxis or yAxis classes. You can check the java tab in the boxplot demo
When enabling scrolling and/or scaling, the data on the graph overlaps the y-axes of the graph. The y-axis labels can be covered and the data can spill out the right hand side too. Is there a method to fix this?
Code:
// min and max are the first and last X-values of the data
graph.getViewport().setXAxisBoundsManual(true);
graph.getViewport().setMinX(min);
graph.getViewport().setMaxX(max);
graph.getViewport().setScalable(true);
graph.getGridLabelRenderer().setNumHorizontalLabels(3);
graph.getGridLabelRenderer().setHumanRounding(false);
Edit: This phenomenon also happens when enabling scaling in the Y axis, only it overlaps the X-axis instead.
I would like to change the view of a 3D plot in matlab such that the y-axis points upward and the z-axis points to left. For example, consider the following plot:
Here the x-axis points forward, the y-axis points to the right and the z-axis points upward.
I would like to have the y-axis points upward and the z-axis points to the left instead. I tried to rotate the plot (using the figure window toolbar rotate button) but I could not get it to work. (It should just be a simple 90 degrees rotation about the x-axis)
Code to generate the plot:
membrane
view(100,50)
xlabel('x-axis');
ylabel('y-axis');
zlabel('z-axis');
grid on
Try using view. I don't have MATLAB available so I can't test it, but I think it can do what you want.
Example from the documentation:
Set the view along the y-axis, with the x-axis extending horizontally
and the z-axis extending vertically in the figure.
view([0 0]);
EDIT:
Try using three inputs to the view function. I can't experiment myself, but you should be able to do it if you choose the right values here.
From documentation:
view([x,y,z]) sets the view direction to the Cartesian coordinates x,
y, and z. The magnitude of (x,y,z) is ignored.
EDIT 2:
Check out camroll. I think camroll(90) (possibly in combination with view) will work.
From documentation:
camroll(dtheta) rotates the camera around the camera viewing axis by
the amounts specified in dtheta (in degrees). The viewing axis is the
line passing through the camera position and the camera target.
This was posted a while ago, but in case someone else is looking for ways to set y-axis as the vertical one here is a possible fix.
Manually: In the command window type cameratoolbar('show') which will open an interactive toolbar in your plot from which you could change the view. One of the options is to set a principle axis to x, y, or z.
Or in you script you could use cameratoolbar('SetCoordSys',coordsys) command which sets the principal axis of the camera motion. coordsys can be: x, y, z, or none.
http://uk.mathworks.com/help/matlab/ref/cameratoolbar.html
There are no possibility to see ToolTip on irregular chart when some points placed on the same X line but with different Y values.
actually I expected observe tooltip in that places where mouse positioned and if the graph Point exist in the small radius around. However for the picture above we can observed tooltip only for the higest and pre-higest points, but not for the lowest and pre-lowes points.
Thanks
Yes, duplicated points on xAxis are not supported for (sp)line series. You can use scatter series with lineWidth: 1 instead.