ChartsOrg / ChartsOrg/Charts

For negative plotting the x-axis and actual x-axis is not overlapping

Open
#4,978 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

> ℹ Please fill out this template when filing an issue.
> All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.
>
> Per our [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md), we use GitHub for
> bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag [`ios-charts`.](https://stackoverflow.com/questions/tagged/ios-charts)
>
> Please remove this line and everything above it before submitting.

* [ ] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md).

## What did you do?

ℹ Created a line chart project with linear mode. For that followed the demonstration code base. So for plotting of positive x values and positive y values. But when I have plotted positive "X" values and negative and positive "Y" values then it seems the (0,0) co-ordinate of the plotted graph is not the same as actual (0,0) co-ordinate.
Plotted the chart as follows :
ChartDataEntry(x: 0.0, y: 8.0)
ChartDataEntry(x: 1.0, y: 42.0)
(ChartDataEntry(x: 3.0, y: 0.0)
(ChartDataEntry(x: 7.0, y: 45.0)
(ChartDataEntry(x: 8.0, y: 28.0)
(ChartDataEntry(x: 10.0, y: 0.0)
## What did you expect to happen?

ℹ Expected that the limit line at 0 x-axis and the actual plot 0 x-axis has to be same.

## What happened instead?

ℹ There is a 12-14 pixels gap between the 0 x-axis and the actual plot 0 x-axis. Please find the below screen shot :

![Simulator Screen Shot - iPhone 12 Pro Max - 2022-11-28 at 23 49 28](https://user-images.githubusercontent.com/49619302/204353004-be721983-3b2d-482f-80b0-a4df59616612.png)

## Charts Environment

**Charts version/Branch/Commit Number:** : v4.1.0
**Xcode version:** 13.0
**Swift version:** Swift 5
**Platform(s) running Charts:** iOS
**macOS version running Xcode:**

## Demo Project

ℹ Please link to or upload a project we can download that reproduces the issue.
[CGWChartsDemo.zip](https://github.com/danielgindi/Charts/files/10106505/CGWChartsDemo.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.