How to customize the minor grid lines style?
This article explains how to customize the minor grid lines’ style in React Chart.
Customize the minor grid line style
You can easily customize the width, color, and dashArray of the minor grid lines by using the minorGridLines property in the axis. This property allows you to achieve precise control over the appearance of the minor grid lines. To enable the minor grid lines, assign a value to the minorTicksPerInterval property. In the following code example, the minor grid line style was customized by using the width, color and dashArray.
Index.js
import { createRoot } from 'react-dom/client';
import * as React from 'react';
import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, SplineSeries, DateTime
} from '@syncfusion/ej2-react-charts';
const Spline = () => {
return (
<chartcomponent id="charts" primaryyaxis="{{" minorticksperinterval:="" 3,="" minorgridlines:="" {="" enable:="" true,="" color:="" 'blue',="" width:="" 2,="" dasharray:="" '2,2'="" }="" }}="">
<inject services="{[SplineSeries," datetime]}="">
<seriescollectiondirective>
<seriesdirective datasource="{data1}" xname="x" yname="y" width="{4}" type="Spline" fill="orange"></seriesdirective>
</seriescollectiondirective>
</inject></chartcomponent>
);
};
export default Spline;
const root = createRoot(document.getElementById('sample'));
root.render(<spline>);
The following screenshot portrays the results of the code snippet mentioned above.
Screenshot:
Refer to the working sample for additional details and implementation: View Sample in Stackblitz
Conclusion
We hope you enjoyed learning how to customize the minor gridlines’ style in the React Chart Component.
You can refer to our React Chart feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our React Chart example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!