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

Message ListMessage List     Post MessagePost Message

  BarLayer not displaying colors
Posted by Diego Iturriaga on Aug-16-2012 02:40
Attachments:
Hi all, i'm using chart director in ASP.NET (C#) and i'm having an issue with the color setting of a barlayer, the bars keep rendering in black color even when i get the legend with the right color (blue and red), here's my code:

/*
SOME PREVIOUS LOGIC TO POPULATE DATASETS
...
*/

/* Creaci?n del la gr?fica */
            XYChart chart = new XYChart(500,300);
            chart.addTitle("Some title here", "tahomabd.ttf", 10, Chart.CColor(Color.Black));
            chart.setPlotArea(45, 25, 450, 220, Chart.CColor(Color.Transparent), -1, Chart.Transparent, Chart.Transparent, Chart.Transparent);
            chart.xAxis().setLabels(xLabels.ToArray()).setFontColor(Chart.CColor(Color.Black));
            chart.setBackground(Chart.CColor(Color.White));
            chart.xAxis().setLabelStyle().setFontSize(7);
            chart.xAxis().setLabelStyle().setFontAngle(60);
            chart.xAxis().setLabelStep(4);
            chart.setRoundedFrame();

            Layer layerBars = chart.addBarLayer2();
            layerBars.addDataSet(xData1.ToArray(), Chart.CColor(Color.Blue), "Something").setLineWidth(3);
            layerBars.addDataSet(xData2.ToArray(), Chart.CColor(Color.Red), "Something else").setLineWidth(2);

            Layer layerLine = chart.addLineLayer();
            layerLine.addDataSet(xData3.ToArray(), Chart.CColor(Color.DeepPink), "Total");

            LegendBox legend = chart.addLegend(175, 22, false, "arial.ttf", 7);
            legend.setBackground(Chart.Transparent,Chart.Transparent);

            webchartview1.Image = chart.makeWebImage(Chart.PNG);


I attached the result chart that i get from this code...

Thanks in advance,
Diego.
dibujo.jpeg

  Re: BarLayer not displaying colors
Posted by Diego Iturriaga on Aug-16-2012 03:02
I'm sorry, i figured it out... there were so many data that borderlines were on top of the colors.

So setting off the borderlines in bars did the trick, here's the line: layerBars.setBorderColor(Chart.Transparent);