Chart2D backgroundColor

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Chart2D backgroundColor

Greg Ederer
Hi,

Is it possible to change the background color of a Chart2D?  I tried
passing a style property into the constructor.  But this had no effect.

Thanks!

Greg

--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| [hidden email]
| 360.774.6848
|

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Chart2D backgroundColor

Eugene Lazutkin
Yes. Pass the fill parameter to the chart when you create it:

var chart = new dojox.charting.Chart2D(node, {
   stroke: "red",  // the outline if you like
   fill:   "#FFC", // the background
});

If you instantiate it as widget, you can specify the same parameters
directly:

<div dojoType="dojox.charting.widget.Chart2D" id="chart1"
      style="width: 300px; height: 300px;"
      stroke="red" fill="#FFC">
...
</div>

Thanks,

Eugene

Greg Ederer wrote:
> Hi,
>
> Is it possible to change the background color of a Chart2D?  I tried
> passing a style property into the constructor.  But this had no effect.
>
> Thanks!
>
> Greg
>

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Chart2D backgroundColor

Greg Ederer
This applies the color to the area outside the plot.  But, the plot area, itself, is still white.  Is there a way to change this color?

Thanks!

Greg

Eugene Lazutkin wrote:
Yes. Pass the fill parameter to the chart when you create it:

var chart = new dojox.charting.Chart2D(node, {
   stroke: "red",  // the outline if you like
   fill:   "#FFC", // the background
});

If you instantiate it as widget, you can specify the same parameters 
directly:

<div dojoType="dojox.charting.widget.Chart2D" id="chart1"
      style="width: 300px; height: 300px;"
      stroke="red" fill="#FFC">
...
</div>

Thanks,

Eugene

Greg Ederer wrote:
  
Hi,

Is it possible to change the background color of a Chart2D?  I tried 
passing a style property into the constructor.  But this had no effect.

Thanks!

Greg

    

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
  


-- 
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| [hidden email]
| 360.774.6848
|

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Chart2D backgroundColor

Eugene Lazutkin
Oh. This is the different question. With the same answer. :-) Pass
"fill" as a plot parameter when you add a plot.

Thanks,

Eugene

Greg Ederer wrote:

> This applies the color to the area outside the plot.  But, the plot
> area, itself, is still white.  Is there a way to change this color?
>
> Thanks!
>
> Greg
>
> Eugene Lazutkin wrote:
>> Yes. Pass the fill parameter to the chart when you create it:
>>
>> var chart = new dojox.charting.Chart2D(node, {
>>    stroke: "red",  // the outline if you like
>>    fill:   "#FFC", // the background
>> });
>>
>> If you instantiate it as widget, you can specify the same parameters
>> directly:
>>
>> <div dojoType="dojox.charting.widget.Chart2D" id="chart1"
>>       style="width: 300px; height: 300px;"
>>       stroke="red" fill="#FFC">
>> ...
>> </div>
>>
>> Thanks,
>>
>> Eugene
>>
>> Greg Ederer wrote:
>>  
>>> Hi,
>>>
>>> Is it possible to change the background color of a Chart2D?  I tried
>>> passing a style property into the constructor.  But this had no effect.
>>>
>>> Thanks!
>>>
>>> Greg
>>>
>>>    
>>
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://dojotoolkit.org/docs/book
>> Forums: http://dojotoolkit.org/forum
>> [hidden email]
>> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>>  
>
>
> --
> | E R G O N O S I S
> | Greg Ederer
> | Lead Developer
> | [hidden email]
> | 360.774.6848
> |
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> [hidden email]
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[hidden email]
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Chart2D backgroundColor

sebilasse
This post has NOT been accepted by the mailing list yet.
You can additionally override each parameter of the theme...
E.g.:
var dc = dojox.charting; /* or require with 1.8 */
var pieChart = new dc.Chart("pieChart");
var _theme = dc.themes.Tom;
_theme.plotarea = { fill: "#ff9600" };
pieChart.setTheme(_theme).addPlot("default", { /* your params */ });
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Chart2D backgroundColor

rekha.subbanna
This post has NOT been accepted by the mailing list yet.
my requirement is to change the color which covers the plot area without modifying the Theme.
If we override the theme it is changing the chart styles like look and feel.so i want to modify the plot area color without modifying the chart.
i tried in both ways

chart.addPlot("scatterPlot", {type: "Scatter", fill: "green" });

chart.addPlot("scatterPlot", {type: "Scatter",plotarea: { fill: "red" }});



but it didnt solve my problem.can  anyone suggest me how to change the color...


Regards,
Rekha S S
Loading...