Draw a line and color it based on direction - echarts

Is it possible to draw a line similar to the example below and color it based on the previous value?
So to have the color red when the line is moving down and green when it goes up.
Can this be done with line type? Or does it need to be drawn with markLine or something else?
Any help is much appreciated!
https://echarts.apache.org/examples/en/editor.html?c=dynamic-data2

I don't think it is possible with the line chart, as the whole line uses the same color for all points. I suggest you use a scatter type chart where each point can have a different color. By setting symbol size to a small value and drawing values close together you can emulate visual line.
Here is an example based on the regression sample from echarts site:

Related

How do I add a categorical legend to a double line graph in Tableau?

Here is my Current View
I'm wanting to add a legend to distinguish between members(yellow line) and casual riders (blue line) so viewers can see which line is which.
Seems like this should be simple, but I feel like I've tried everything. The closest I've come is by getting a legend to pop up by dragging measure values over to the color, but then it changes my colors that I have already established and syncs both lines as the same color or gradient of colors. All I need is a legend detailing which line is which.
Instead of individually changing each line's color, place Measure Names in the Color shelf of All marks card. This should make the legend appear on the right.

If I have 4 coordinates making a rectangle, how can I color in that area?

I have 4 coordinates assigned to variables, so I would just like to colour in the rectangle that is created from these variables. I tried the fill function, but I cant gather much information from the example.
When I try to use:
fill(bottom left point, top right point,'g')
the figure it makes only shows a line between those points, and doesn't colour in the entire area.
I'm using MATLAB R2019b, if that helps.
Also, if its possible to fill the rectangle with a pattern instead, please let me know aswell.
Thanks in advance

How to get rid of gradient color system in Tableau line chart

I'm getting gradient colored lines over the chart.
How can I bring them to single color?
It sounds like you have a measure in your color shelf; remove the measure from the shelf, and then set a color for the lines. This part of the Desktop User Guide explains the marks card

matlab: bar, how to change the edge color?

I am having trouble to change the bar color, I want it to be white in the middle, and red at the edge. Looking at matlab's description
if I do:
bar(y,'FaceColor','w','EdgeColor','r','LineWidth',1)
It should give me the above. However, when I actually run it, it only give me white graph.
Update: my y is:
y=zeros(1,5000); y(3000)=1; y(4000)=1;
Using the above, I got....
With so many bars, Matlab probably has trouble differentiating edge ('EdgeColor') and fill ('FaceColor') of each. After all, each complete bar is less than a screen pixel.
I suggest you use white edge and colored fill. That works for me. It's as if 'FaceColor' had precedence over 'EdgeColor'.
bar(y,'FaceColor','r','EdgeColor','w','LineWidth',1)
Or better yet: replace each bar by a line, that is, use stem:
stem(y,'r','marker','none')

Setting the line width in a smart gwt facetchart

I'm unsing the FacetChart widget to display several graphs at the same time. The default line width while using the ChartType.LINE is quite big. It is hard to differentiate graphs with nearly similar values.
Is there a way to set a smaller line width?
Using FusionCharts, it is possible to set the line width by just setting "lineThickness" attribute. Also, it supports various attributes to configure how your line plot will appear on the chart. It can be shown as dashed lines, lines plots using various colors etc. Give a TRY!!!