Cannot set the thickest plot style  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Cannot set the thickest plot style

Postby JoshM » 23 Sep 2014

Using MultiCharts .NET64 Version 8.8 Release (Build 8365).

Code: Select all

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using System.Collections.Generic;

namespace PowerLanguage.Indicator
{
public class Snippet_Indicator : IndicatorObject
{
public Snippet_Indicator(object _ctx) : base(_ctx) { }

private IPlotObject plot1, plot2, plot3, plot4, plot5, plot6, plot7, plot8, plot9, plot10;

protected override void Create()
{
plot1 = AddPlot(new PlotAttributes("plot1", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 0, EPlotStyle.Solid, true));

plot2 = AddPlot(new PlotAttributes("plot2", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 1, EPlotStyle.Solid, true));

plot3 = AddPlot(new PlotAttributes("plot3", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 2, EPlotStyle.Solid, true));

plot4 = AddPlot(new PlotAttributes("plot4", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 3, EPlotStyle.Solid, true));

plot5 = AddPlot(new PlotAttributes("plot5", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 4, EPlotStyle.Solid, true));

plot6 = AddPlot(new PlotAttributes("plot6", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 5, EPlotStyle.Solid, true));

plot7 = AddPlot(new PlotAttributes("plot7", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 6, EPlotStyle.Solid, true));

plot8 = AddPlot(new PlotAttributes("plot8", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 7, EPlotStyle.Solid, true));

plot9 = AddPlot(new PlotAttributes("plot9", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 8, EPlotStyle.Solid, true));

plot10 = AddPlot(new PlotAttributes("plot10", EPlotShapes.Point,
Color.ForestGreen, Color.Transparent, 9, EPlotStyle.Solid, true));
}

protected override void CalcBar() { }
}
}
Gives:

Image

The last 3 plots all have a line that not the thickest, despite this being specified in the `PlotAttributes` with the increasing value for plot lines (the values 7, 8, 9).

It seems that the value of 7 does not set the line to the thickest version, even though I believe it should do that. In other words, I cannot programmatically set the plot thickness to the highest value, while all the other thickness can be set.

I've searched the logs for the MC 9.0 beta versions, but could not find an entry for this.
Attachments
scr.23-09-2014 13.59.39.png
(5.38 KiB) Downloaded 598 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Cannot set the thickest plot style  [SOLVED]

Postby Henry MultiСharts » 25 Sep 2014

Hello, JoshM.

Line width can range from 1 to 14. Values 11-14 correspond to the thickest plot of the Weight Selector in the Format Study - Style window.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Cannot set the thickest plot style

Postby JoshM » 25 Sep 2014

Line width can range from 1 to 14. Values 11-14 correspond to the thickest plot of the Weight Selector in the Format Study - Style window.
Thanks for responding and answering, but that undocumented feature does not make much sense I think:

* value 0 = line option 1
* value 1 = line option 1
* value 2 = line option 2
* value 3 = line option 3
* value 4 = line option 4
* value 5 = line option 5
* value 6 = line option 6
* value 7 = line option 6
* value 8 = line option 6
* value 9 = line option 6
* value 10 = line option 6
* value 11 = line option 7
* value 12 = line option 7
* value 13 = line option 7
* value 14 = line option 7

So values 1 through 6 correspond to line widths 1 through 6 (which makes sense), values 7 through 10 are redundant, and 11 through 14 correspond to line width 7.

I'm sorry to say but it seems that there has not been put much thought into this. Since the line width is also set by a literal value, this "error" cannot be changed anymore without introducing code breaking changes (so two "errors", actually).

But perhaps an enum can be added in a future version to make this somewhat more intuitive to use?

Code: Select all

enum LineWidth
{
Width1 = 1,
Width2 = 2,
Width3 = 3,
Width4 = 4,
Width5 = 5,
Width6 = 6,
Width7 = 11,
}

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Cannot set the thickest plot style

Postby Henry MultiСharts » 30 Sep 2014

I'm sorry to say but it seems that there has not been put much thought into this. Since the line width is also set by a literal value, this "error" cannot be changed anymore without introducing code breaking changes (so two "errors", actually).

But perhaps an enum can be added in a future version to make this somewhat more intuitive to use?
This behavior is determined by the backward compatibility of PowerLanguage (predecessor of MC .NET ) with EL.

I have forwarded your suggestion regarding adding an enum to our developers.


Return to “MultiCharts .NET”