|
C++ DataSet.setDataSymbol not getting default color from line |
Posted by Michael on Aug-05-2015 20:40 |
|
Since I upgraded to 6.0 from 5.6 my charts had no symbols in them.
DataSet *dset=layer->addDataSet(DoubleArray(coldata,m_datasrc->GetRowsCount()));
dset->setDataSymbol(Chart::SquareSymbol, 7,-1,-1,4);
Works just fine in the older version.
In the newer version I added the following to debug
int color=dset->getDataColor();
color here is always 0xffffffff
dset->setDataSymbol(Chart::SquareSymbol, 7,-1,Chart::DataColor+col,4);
If I manually setup the colors like this it works correctly and has solid boxes. |
Re: C++ DataSet.setDataSymbol not getting default color from line |
Posted by Peter Kwan on Aug-06-2015 02:34 |
|
Hi Michael,
I have just tested with your code. My testing results is as follows:
In ChartDirector 5, there is a line chart with symbols. The symbol is a square symbol, with
the fill color the same color as that of the line. The symbol includes a 1-pixel border in the
default border color (normally black, but can be configured with Layer.setBorderColor). The
latest argument "4" in setDataSymbol is not used as ChartDirector 5 does not support
border width for square symbols.
In ChartDirector 6, the border width is supported in square symbols. As a result, the square
symbol will have 4-pixel thick border in the default border color. Since the entire symbol is
only 7 pixels in size, so the entire symbol is filled by thick border. In other words, the entire
symbol will be the color of the thick border.
From your description, I guess your intention is to have a 1-pixel thick border, since that is
what ChartDirector 5 draws. If this is the case, please try to set the last argument to
setDataSymbol to 1 instead of 4.
Please kindly let me know if this can solve the problem.
Regards
Peter Kwan |
Re: C++ DataSet.setDataSymbol not getting default color from line |
Posted by Michael on Aug-06-2015 03:06 |
|
Yes, thanks that is in fact the problem. I didn't realize that the border was not supported in version 5 so that explains the change in behaviour.
thanks |
|