Articles in this section

How to view corner data point without cutting in edge of React Chart?

This article explains how to view corner data point without cutting in edge of the React Chart.

Customize the appearance of corner data point without cutting at the edge

Solution 1:

You can view the edge data points without cutting or overlapping in the chart by setting the plotOffset property in the axis.

In the following code example, the plotoffset property is applied for both axis.

Index.js

    <chartcomponent id="charts" primaryxaxis="{{" edgelabelplacement:="" 'shift',="" linestyle:="" {="" width:="" 2="" },="" valuetype:="" 'category',="" labelplacement:="" 'onticks',="" plotoffset:="" 12="" }}="" primaryyaxis="{{" minimum:="" 0,="" maximum:="" 10,="" interval:="" 2,="" rangepadding:="" 'none',="" 15="">
       <inject services="{[ScatterSeries," category]}="">
       <seriescollectiondirective>
           <seriesdirective datasource="{scatterData}" width="{2}" xname="x" yname="y" type="Scatter" marker="{{" visible:="" false,="" width:="" 15,="" height:="" shape:="" 'circle',="" }}="">
       </seriesdirective></seriescollectiondirective>
   </inject></chartcomponent>   

Screenshot:

React chart appearance adjusted using plotOffSet

View Sample in Stackblitz

Solution 2:

You can view the edge data point without cutting in chart by setting rangePadding property as Additional in axis.

In the following code example, the range padding as additional applied for both axis.

Index.js

   <chartcomponent id="charts" primaryxaxis="{{" linestyle:="" {="" width:="" 2="" },="" valuetype:="" 'double',="" labelplacement:="" 'onticks',="" rangepadding:="" 'additional'="" }}="" primaryyaxis="{{" minimum:="" 0,="">
       <inject services="{[ScatterSeries]}">
       <seriescollectiondirective>
           <seriesdirective datasource="{scatterData}" width="{2}" xname="x" yname="y" type="Scatter" marker="{{" visible:="" false,="" width:="" 15,="" height:="" shape:="" 'circle'="" }}="">
       </seriesdirective></seriescollectiondirective>
    </inject></chartcomponent>  

Screenshot:

React chart appearance adjusted using range padding additional

Refer to the working sample for additional details and implementation: View Sample in Stackblitz

If you are using a primary x-axis as a DateTime axis, you can use the following solution.

Index.js

    <chartcomponent id="charts" primaryxaxis="{{" valuetype:="" 'datetime',="" labelformat:="" 'mmm',="" linestyle:="" {="" width:="" 2="" },="" rangepadding:="" 'additional'="" }}="" primaryyaxis="{{">
       <inject services="{[ScatterSeries," datetime]}="">
       <seriescollectiondirective>
          <seriesdirective datasource="{scatterData}" width="{2}" xname="x" yname="y" type="Scatter" marker="{{" visible:="" false,="" width:="" 15,="" height:="" shape:="" 'circle'="" }}="">
       </seriesdirective></seriescollectiondirective>
   </inject></chartcomponent>

Screenshot:

React chart appearance adjusted using range padding datetime

Refer to the working sample for additional details and implementation: View Sample in Stackblitz

Solution 3:

You can view the edge data point without cutting in chart by setting minimum and maximum property in axis.

In the following code example, the minimum and maximum is applied for both axis.

Index.js

    <chartcomponent id="charts" primaryxaxis="{{" linestyle:="" {="" width:="" 2="" },="" valuetype:="" 'double',="" labelplacement:="" 'onticks',="" minimum:="" 0,="" maximum:="" 8,="" interval:="" 1="" }}="" primaryyaxis="{{" 12,="" 2,="" }="">
       <inject services="{[ScatterSeries]}">
       <seriescollectiondirective>
           <seriesdirective datasource="{scatterData}" width="{2}" xname="x" yname="y" type="Scatter" marker="{{" visible:="" false,="" width:="" 15,="" height:="" shape:="" 'circle'="" }}="">
       </seriesdirective></seriescollectiondirective>
    </inject></chartcomponent>

Screenshot:

React chart appearance adjusted using minimum and maximum

Refer to the working sample for additional details and implementation: View Sample in Stackblitz

Conclusion

We hope you enjoyed learning how to view corner data points without cutting into the edge of 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!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied