ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  SplineLayer with semi-transparent line has darker overlapped areas...
Posted by Patrick on Jan-13-2015 01:57
Attachments:
When I use a SplineLayer with the following code, it creates "folded" areas in the spline
line that are darker than the rest of the line. Anyway to avoid this? See image below the
code.

Thanks!


    ' The data for the line chart
    Dim data() As Double = {85,  77,  50,  40,  75,  30,  20,  45,  45,  55,  85,  50,  55,
20,  30,  80,  25,  85,  30,  45,  80}
    Dim data2() As Double = {62, 51,  56,  54,  58,  44,  24,  56,  54,  56,  62,  45,  86,
24,  44,  51,  65,  62,  44,  56,  51}
    Dim data3() As Double = {51 ,60,  41,  62,  68,  40,  24,  41,  62,  41, 51,  43,  100,
24,  40,  60,  56,  51, 40,  41,  60}

    ' The labels for the line chart
    Dim labels() As String = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", _
        "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21"}

    ' Create a XYChart object of size 250 x 250 pixels
    Dim c As XYChart = New XYChart(800, 250)

    ' Set the plotarea at (30, 20) and of size 200 x 200 pixels
    c.setPlotArea(30, 20, 775, 200)

    Dim slayer As SplineLayer = c.addSplineLayer()

    ' Set the default line width to 2 pixels

    ' Add the three data sets to the line layer. For demo purpose, we use a dash line
    ' color for the last line
    slayer.addDataSet(data, &H800E0E0E)

    Dim ds as DataSet = slayer.getDataSet(0)
    ds.setLineWidth(20)

    Dim layer As LineLayer = c.addLineLayer2()
    layer.setLineWidth(2)
    layer.addDataSet(data2, c.dashLineColor(&H3333ff, Chart.DashLine))
    layer.addDataSet(data3, &H663300)

    ' Set the labels on the x axis.
    c.xAxis().setLabels(labels)
Screen Shot 2015-01-12 at 12.54.28 PM.png

  Re: SplineLayer with semi-transparent line has darker overlapped areas...
Posted by Peter Kwan on Jan-13-2015 04:30
Hi Patrick,

Unluckily, this is just the way ChartDirector renders the spline and cannot be avoided. We
suggest to use only transparent colors for shapes and text, but not for the curve.

Regards
Peter Kwan

  Re: SplineLayer with semi-transparent line has darker overlapped areas...
Posted by Patrick on Jan-13-2015 05:11
Thank you.