Page 1 of 1

ILineSeries.ColorEachLine inconsistency

Posted: Fri Feb 17, 2006 2:57 am
by 9526208
There is a possible inconsistency in the logic of ILineSeries.ColorEachLine flag.
It doesn't do anything if ISeries.ColorEachPoint is "false". Please refer sample code and it's comments for all four combination of these parameters.

Code: Select all

    static void Main(string[] args)
    {
      ITChart pChart = new TChartClass();
      pChart.SetTheme(EChartTheme.ctExcel, EColorPalette.cpExcel); // just to make chart look nicer
      pChart.Aspect.View3D = false;

      int idx = pChart.AddSeries(ESeriesClass.scLine);
      ISeries pSeries = pChart.Series(idx);
      ILineSeries pAreaSeries = (ILineSeries)pSeries.asLine;
      
      pAreaSeries.Pointer.Visible = true;
      pAreaSeries.Pointer.Style = EPointerStyle.psDiamond;
      pAreaSeries.Pointer.HorizontalSize = 4;
      pAreaSeries.Pointer.VerticalSize = 4;

      // add data
      for (int i = 0; i < 7; i++)
        pSeries.AddXY(i, i, null, (uint)EConstants.clTeeColor);
      
      // export graph to observe the problem 
      IBMPExport pBMP = pChart.Export.asBMP;
      pBMP.Height = 250;
      pBMP.Width = 600;
      
      // set one of series data colors to user defined color
      pSeries.set_PointColor(1,0xff); //red
      
      // uses default color to draw points (except point color for point 1) 
      // and default color for line segments
      pSeries.ColorEachPoint = false;
      pAreaSeries.ColorEachLine = false;
      pBMP.SaveToFile("c:\\tee_1_CEPointFalse_CELineFalse.bmp");

      // uses palette colors to draw points (except point color for point 1)
      // and default color for line segments
      pSeries.ColorEachPoint = true;
      pAreaSeries.ColorEachLine = false;
      pBMP.SaveToFile("c:\\tee_2_CEPointTrue_CELineFalse.bmp");

      // uses palette colors to draw points(except point color for point 1)
      // DOES IT USE palette colors for line segments(except point color for line segment 1)
      // OR same colors as points do?
      pSeries.ColorEachPoint = true;
      pAreaSeries.ColorEachLine = true;
      pBMP.SaveToFile("c:\\tee_3_CEPointTrue_CELineTrue.bmp");

      // uses default color to draw points(except point color for point 1)
      // and default color for line segments
      // BUT SHALL IT USE palette colors for line segments(except point color for line segment 1)?
      // OR same colors as points do?
      // JUST LIKE in case 3?
      pSeries.ColorEachPoint = false;
      pAreaSeries.ColorEachLine = true; //<<<< produces the same picture as in case 1 "tee_1_CEPointFalse_CELineFalse"
      pBMP.SaveToFile("c:\\tee_4_CEPointFalse_CELineTrue.bmp");
    }

Posted: Mon Feb 20, 2006 11:29 am
by Pep
Hi Alex,

this is by default, but this is not commented in the AcitveX Help, it must say (as for the next maintenance releases) :
Description
The ColorEachLine is used when a Series ColorEachPoint property is True.

This property determines if the lines connecting points in a Line Series will also be displayed using a different color for each line segment.

When ColorEachPoint is False, this property is not used.

Posted: Mon Feb 27, 2006 9:20 pm
by 9526208
Well, why not to allow ColorEachLine to work independently of
ColorEachPoint? It would give more flexibility to the software users.

Here is a simplified example.

Application has a "table" window and "default-color line-chart" window
"linked" together.

When user clicks on a table row, correspondent segment of line will be
selected.

But it's not possible in ColorEachPoint=false mode. Only a line symbol
(not line segment) will be painted with custom color of selection. If
line chart has "empty" symbol we will not see selection. To paint line
segment, application needs to set ColorEachPoint=true and set ALL colors
to default color etc etc...

Real-life case is more complex and this workaround is not applicable
really smoothly. Having these line chart properties work independently
would help to reduce code complexity and increase UI intuitiveness.

Posted: Thu Mar 02, 2006 8:12 am
by Pep
Hi Alex,

ok, we'll consider it, I've added on our wish list to be considered for further releases.
A way around this would be to use two LineSeries, one with Pointer visible, and the other not, setting the colorEachLine and colorEachPoint to True, similar to :

Code: Select all

Private Sub Form_Load()
With TChart1.Series(0)
    .FillSampleValues (5)
    .asLine.ColorEachLine = True
    .ColorEachPoint = True
End With
With TChart1.Series(1)
    .DataSource = TChart1.Series(0)
    .asLine.LinePen.Visible = False
    .asLine.Pointer.Visible = True
End With
TChart1.Series(0).PointColor(1) = vbBlack
End Sub

Posted: Fri Mar 03, 2006 11:13 pm
by 9526208
An important addition!

Commenting the line
//pChart.Aspect.View3D = false;(3d mode ON),
actually allows ColorEachLine to work independently of
ColorEachPoint.

Pls compare tee_4_CEPointFalse_CELineTrue.bmp for both cases.

Can this make possible adjusting the behavior for 2d in a new maintenance release?

Posted: Tue Mar 14, 2006 4:12 pm
by Pep
Hi,

in 2D only the color of pointer is changed setting a PointColor. This is because SeriesColor is used as a Pen for the Line.

We'll try to improve this for the next releases.

Bug ID?

Posted: Wed Nov 08, 2006 5:07 am
by 9526208
Hello Pep.

Could you please provide your bug ID number for this request?
(We are trying to improve our issue tracking)

Thanks,
Juan

Posted: Wed Nov 08, 2006 1:28 pm
by narcis
Hi Juan,

This is TV52011295 however it is a feature request, not a bug.