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

Message ListMessage List     Post MessagePost Message

  Overlapping Background
Posted by Travis on Jun-24-2015 13:14
Attachments:
I'm displaying a finance chart on a web page using png as the output.  My page's
background color is an off white (#F8FBFC to be exact).  When I add a line indicator panel
using addLineIndicator, I change the background color to my page's color.

xy = m.addLineIndicator(150, dblMACDLineOutput, intLineColor, "MACD")
xy.setBackground(16317436)

The problem is when I do the above, my line indicator xy chart appears to overlap the
bottom portion of the primary finance chart above it.  It trims off the bottom of the volume
bars and the border of the primary finance chart is missing.

I suspect the bottom xy chart is overlapping the top xy chart.

I've played around with setTransparentColor and making the background color itself
Chart.Transparent, but nothing seems to work.

Any assistance would be greatly appreciated.
overlap.jpg

  Re: Overlapping Background
Posted by Peter Kwan on Jun-25-2015 00:29
Hi Travis,

The main price chart and all indicator charts are transparent by default. that's why they will
not block each others despite overlapping. For your case, I think what you need is to set
the FinanceChart itself to transparent or to the same color as the web page background.

m.setBackground(Chart.Transparent)

Hope this can help.

Regards
Peter Kwan

  Re: Overlapping Background
Posted by Travis on Jun-25-2015 01:49
I had tried setting the background to transparent on the main chart before, but evidently I
was doing it wrong.

In case it helps someone else, the following lines did not make my primary chart background
transparent:
Dim m As FinanceChart = New FinanceChart(intWidth)
........
pChart = m.addMainChart(intHeight)
pChart.setBackground(Chart.Transparent)

Instead, this is what I ended up using:
Dim m As FinanceChart = New FinanceChart(intWidth)
.......
pChart = m.addMainChart(intHeight)
m.setBackground(Chart.Transparent)

I believe the difference is the addMainChart hands back an XYChart and is not the same
thing as the "m" variable above which holds a reference to the FinanceChart object.

Thanks Peter for your help!

Travis