Hello,
I like to create a bar with a colored dash in it. I can not get it to work. I want the dash to be the width of the bar and have a line size that scales with the graph.
I tried the following (and lots more):
Code used to fill the line:
I do not like to use markers as it will just create a marker per bar and these do not scale. I have a working solution in a figure, that just draws dashes in all visible bars, I want to get rid of that as it is a special. It should be possible with the descriptors somehow, I think.
How to do this with a descriptor (dash has width of bar and dash line size that scales with the size of the chart) ?
Moti.
I like to create a bar with a colored dash in it. I can not get it to work. I want the dash to be the width of the bar and have a line size that scales with the graph.
I tried the following (and lots more):
- a not continuous line, still draws a continuous line (do not understand what continuous intends, manual: Sets the continuous option for the path)
Code:
PathDescriptor pathDescriptor1 = new PathDescriptor(Inputs.DASH_ON_BAR, "A dash on a bar", Color.RED, 3, null);
pathDescriptor.setContinuous(false);
- a line of dashes, which draws a line of dashes, however the size does not follow the Enums.Size argument (the dash looks always small) and the dash not scale with the graph (tried to set width to 0 with setFixedWidth for auto sizing, manual: Sets the fixed width for displaying bars (null for dynamic width). As a result with a few bars on the screen a very small dash is shown.
Code:
PathDescriptor pathDescriptor1 = new PathDescriptor(Inputs.DASH_ON_BAR, "A dash on a bar", Color.RED, Enums.PointType.DASH, Enums.Size.LARGE, true, false, true);
pathDescriptor.setContinuous(false);
pathDescriptor.setFixedWidth(0);
Code:
rd.declarePath(Values.DASH_ON_BAR, Inputs.POC_BAR);
Code:
dataContext.getDataSeries().setPathColor(index, Values.DASH_ON_BAR, color);
dataContext.getDataSeries().setDouble(index, Values.DASH_ON_BAR, price);
dataContext.getDataSeries().setComplete(index);
I do not like to use markers as it will just create a marker per bar and these do not scale. I have a working solution in a figure, that just draws dashes in all visible bars, I want to get rid of that as it is a special. It should be possible with the descriptors somehow, I think.
How to do this with a descriptor (dash has width of bar and dash line size that scales with the size of the chart) ?
Moti.