Current filter:
                                You should refresh the page.
                                  • Hello

                                    I need to change my chart area-color with a css class.

                                    A picture of my chart is attached.

                                    I want to be able to do

                                    [XAML]
                                    <BootstrapChart ...............> <CssClasses Area="myClass" > </BootstrapChart>

                                    Where myClass has something like: background-color: #000;

                                    I know this isnt possible at the moment, but is there a workaround or a solution that works on a client-side css/js level?

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,

                                You can specify the area color for BootstrapChartAreaSeries by using the corresponding Color property:

                                [ASPx]
                                <dx:BootstrapChartAreaSeries ValueField="y65" Name="65 years and older" Color="Red"\>

                                or by specifying the series' CssClass property to the following CSS class:

                                [ASPx]
                                <dx:BootstrapChartAreaSeries ValueField="y1564" Name="15-64 years" CssClass="testCSS" \>
                                [CSS]
                                .testCSS .dxc-elements{ fill: red; }

                                Note that in this scenario it's necessary to use "fill" instead of "background-color" because the visible area is implemented with an .svg image.
                                If this approach doesn't help, please describe your scenario in greater detail. Why doesn't the built-in Color property meet your requirements and do you need to change the area color dynamically?

                                • Ágúst Helgason 08.13.2019

                                  Hello Lanette,

                                  Yes I'm changing the color dynamically using CSS-variables so the built-in Color property is not enough but this is just what i needed :)

                                  But I had to change the css class definition to:
                                  .dxc-elements.testCSS

                                  Thank you

                                • Lanette (DevExpress Support) 08.13.2019

                                  You are welcome!