Hello All,

  I noticed a couple of curious things when plotting in python. The first is that if I try to add color to a bar chart, the type automatically changes to a line (rather than a bar) in the final chart. 

Here is how I am adding it, maybe I am doing something wrong?

# Create a custom volume chart VolChart = Chart("Volume") VolChart.AddSeries(Series('Buying Volume', SeriesType.Bar, Color.Green)) VolChart.AddSeries(Series('Selling Volume', SeriesType.Bar)) self.AddChart(VolChart)

and this is how I am plotting it:

if data[self.sym].Close >= data[self.sym].Open: self.Plot('Volume', 'Buying Volume', data[self.sym].Volume) else: self.Plot('Volume', 'Selling Volume', data[self.sym].Volume)

In the resulting chart, the buying volume is a green line chart whilst the selling volume is an actual bar chart. 

https://i.imgur.com/hV7oYdI.png

The next thing I noticed is that if I add color to both of the series, so my code now looks like this:

VolChart = Chart("Volume") VolChart.AddSeries(Series('Buying Volume', SeriesType.Bar, Color.Green)) VolChart.AddSeries(Series('Selling Volume', SeriesType.Bar, Color.Red)) self.AddChart(VolChart)

 

I get the following error: ( Chart series name already exists ) 

281 | 00:46:15: During the algorithm initialization, the following exception has occurred: Exception : Chart.AddSeries(): Chart series name already exists at QuantConnect.Chart.AddSeries (QuantConnect.Series series) [0x00031] in <8020d7f9c1ca4bb3822d930f6f8ac032>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <2e7c1c96edae44d496118948ca617c11>:0 at Initialize in main.py:line 37 Exception : Chart.AddSeries(): Chart series name already exists at QuantConnect.Chart.AddSeries (QuantConnect.Series series) [0x00031] in <8020d7f9c1ca4bb3822d930f6f8ac032>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <2e7c1c96edae44d496118948ca617c11>:0

Finally, if I remove Color from both the lines, my volume chart appears as expected... just without the colors I want:

https://i.imgur.com/ktFBTO6.png

 

So am I missing something or making mistakes?