FusionCharts for Dreamweaver - Developer Edition Forum


box FusionCharts for Dreamweaver - Developer Edition
FusionCharts is a Dreamweaver Charting Extension that can be used to render data-driven & animated charts for web applications and presentations. FusionChartsDW is a cross-browser and cross-platform solution that can be used with ASP.VB, PHP, and ColdFusion to deliver interactive and powerful flash charts.

Find out more about FusionCharts for Dreamweaver - Developer Edition

Thread: limit the number of colors used on a bar graph

title left
User Details
message
title right
Sheldon M Bloch

post date:
2011-05-12 09:53:57
I would like to know if there is a way to limit the number of colors used on a bar graph.rnrnWhen I graph a series over time many colors are used on the bars. Is there a way to limit the colors to 2?rnrn
Andrei Rinciog [Extend Studio]

post date:
2011-05-13 05:24:34
Hello Sheldon,

You can set the color of each bar by using the "color" parameter from the "add/edit series" pop-up. You can set it to a color value or you can use a column from the recordset to define a different color for each record.

Regards,
Andrei Rinciog
Sheldon M Bloch

post date:
2011-05-13 09:20:34
I set the color of the series and still get many colors when the graph is produced. I want to limit the colors to 2.
Andrei Rinciog [Extend Studio]

post date:
2011-05-16 05:24:21
Hello,

Don't set the color using the color picker from the series list. You must click on the edit button to edit the series and then set the color in the "edit series" pop-up.

Regards,
Andrei Rinciog
Sheldon M Bloch

post date:
2011-05-16 09:31:15
When I set the color I get one color or many colors(1 series). I want to limit the colors to 2.
Andrei Rinciog [Extend Studio]

post date:
2011-05-17 05:53:28
Hello again,

You can't limit the number of colors for bar charts from our interface but you can do it by altering the generated code.

Each chart has its properties kept in a file called "fc_ChartName_data". Inside that file you can find an xml object. Add colors to the chart like this:

<chart colorPalette="ff0000,00ff33 .. "

Regards,
Andrei Rinciog
Sheldon M Bloch

post date:
2011-05-17 09:31:16
Thank youu.

That will work fine.
Sheldon M Bloch

post date:
2011-05-17 10:22:50
I looked for the <chart colorpallette in the file and did not find it.

I then hard coded the item in the file. Had to use single instead of double quotes. the chart still had many colors.

Below is the contents of the file before the hard code.

<chart alternateHGridColor='eeeeee' valuePadding='2' slantLabels='0' xAxisNamePadding='5' zeroPlaneThickness='2' chartRightMargin='15' rotateLabels='0' useRoundEdges='0' yAxisMaxValue='' alternateHGridAlpha='50' placeValuesInside='0' captionPadding='10' divLineThickness='1' adjustDiv='1' labelDisplay='WRAP' setAdaptiveYMin='0' zeroPlaneColor='acbb99' zeroPlaneAlpha='75' canvasBorderThickness='2' chartBottomMargin='15' showYAxisValues='1' plotSpacePercent='20' showValues='1' yAxisMinValue='' xAxisName='' rotateValues='0' yAxisNamePadding='5' yAxisName='' yAxisValuesStep='1' canvasBorderColor='545454' canvasBorderAlpha='100' numDivLines='4' showLabels='1' divLineColor='acbb99' divLineAlpha='100' showLimits='1' labelPadding='3' showShadow='0' chartLeftMargin='15' staggerLines='2' showDivLineValues='1' chartTopMargin='15' plotFillAngle='0' plotFillRatio='0,100' plotFillAlpha='100,100' plotGradientColor='ffffff' showPlotBorder='0' showAlternateHGridColor='1' divLineIsDashed='0' canvasBgColor='dde3d5' canvasBgAlpha='100' rotateYAxisName='1' labelStep='1' yAxisValuesPadding='2' showToolTip='1' baseFontColor='49563a' seriesNameInTooltip='1' exportFormats='PDF=Export as PDF|PNG=Export as PNG|JPG=Export as JPG' toolTipBorderColor='49563a' numberScaleValue='1000,1000' exportDataSeparator=',' exportFileName='type file name' formatNumberScale='1' exportCallback='' yAxisValueDecimals='2' baseFont='Verdana' animation='1' numberScaleUnit='K,M' exportDataFormattedVal='1' showAboutMenuItem='1' aboutMenuItemLabel='' bgSWF='' outCnvBaseFontSize='10' exportDataMenuItemLabel='Copy the data of this chart' numberSuffix='' logoPosition='TL' showBorder='0' exportShowMenuItem='1' defaultNumberScale='' outCnvBaseFontColor='49563a' formatNumber='1' subCaption='' decimals='2' showExportDataMenuItem='1' decimalSeparator='.' logoScale='100' bgSWFAlpha='100' logoLink='' numberPrefix='' thousandSeparator=',' aboutMenuItemLink='' clickURL='' baseFontSize='10' outCnvBaseFont='Verdana' caption='' forceDecimals='0' defaultAnimation='1' exportEnabled='1' logoAlpha='100' exportDataQualifier='{quot}' logoURL='' bgAlpha='100' bgColor='FFFFFF' exportAtClient='1' toolTipBgColor='ffffff' toolTipSepChar=', ' exportHandler='fc_exp_FusionChart16'> <dynamicData>{FCDW_DATA}</dynamicData></chart>
Andrei Rinciog [Extend Studio]

post date:
2011-05-18 05:10:11
Hello again,

The attribute is not already created. You need to insert it in the xml. Place the colorPalette attribute here:

<chart colorPalette='ff0000,ff00ff' alternateHGridColor='eeeeee' ....

Regards,
Andrei Rinciog
Sheldon M Bloch

post date:
2011-05-18 10:00:12
Added code. I still have 9 colors.

Below is the chart code

Dim dFCFusionChart222: Set dFCFusionChart222 = new DWFChart
FusionChart222_dataXML = ReadDisplayFile("includes/FusionCharts/dynamic/data/fc_FusionChart222_data.asp")
dFCFusionChart222.Init "FusionChart222", "Column2D", "includes/FusionCharts/charts/", 800, 400, "", "", "", "", "", ""
dFCFusionChart222.setVersion "1.1.1"
dFCFusionChart222.setConfigXML FusionChart222_dataXML
dFCFusionChart222.setCategory rsDashboard, "theTime", "useExport=true", "", rsDashboard_cmd
dFCFusionChart222.addSeries rsDashboard, "Actual", "linkColumn={theTime}", "color='4505b' seriesName='Actual' renderAs='Column' parentYAxis='P'", "default", "", rsDashboard_cmd
dFCFusionChart222.setOrdering "None", "asc"
dFCFusionChart222.prepareData
Andrei Rinciog [Extend Studio]

post date:
2011-05-19 05:43:21
Hello Sheldon,

Please send me a zip archive with your page and the includes folder and I will add the colors in the code and send you the pages back.

Send the archive to support at extendstudio.com

Regards,
Andrei Rinciog
Sheldon M Bloch

post date:
2011-05-23 16:17:44
Sent the file today.
Andrei Rinciog [Extend Studio]

post date:
2011-05-24 04:17:50
Hello Sheldon,

I'm sorry, I made a mistake above. The name of the parameter is "paletteColors" not "colorPalette".

I sent you the modified file by email.

Regards,
Andrei Rinciog