DevExtreme v26.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Gauges - Palette

In this demo, the BarGauge uses one of the predefined palettes for coloring bars. To specify a custom palette, assign an array of colors to the palette property.

Backend API
import React from 'react'; import { BarGauge, Label, Export, Title, Font, } from 'devextreme-react/bar-gauge'; const values = [-2.13, 1.48, -3.09, 4.52, 4.9, 3.9]; function App() { return ( <BarGauge id="gauge" startValue={-5} endValue={5} baseValue={0} values={values} palette="Ocean" > <Label format="##.## mm;-##.## mm" /> <Export enabled={true} /> <Title text="Deviations in the Manufactured Parts"> <Font size={28} /> </Title> </BarGauge> ); } export default App;
import React from 'react'; import { BarGauge, Label, Export, Title, Font, } from 'devextreme-react/bar-gauge'; const values = [-2.13, 1.48, -3.09, 4.52, 4.9, 3.9]; function App() { return ( <BarGauge id="gauge" startValue={-5} endValue={5} baseValue={0} values={values} palette="Ocean" > <Label format="##.## mm;-##.## mm" /> <Export enabled={true} /> <Title text="Deviations in the Manufactured Parts"> <Font size={28} /> </Title> </BarGauge> ); } export default App;
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.tsx'; ReactDOM.render( <App />, document.getElementById('app'), );
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.js'; ReactDOM.render(<App />, document.getElementById('app'));
<!DOCTYPE html> <html lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/css/dx.light.css" /> <link rel="stylesheet" type="text/css" href="./bundle.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"></div> </div> <script src="bundles/vendor/react.vendor.js"></script> <script src="./bundle.js"></script> </body> </html>
#gauge { height: 440px; width: 100%; }