Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom xAxis, e.g., horizontal, line drawing has been implemented #584

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zahangirbd
Copy link

@zahangirbd zahangirbd commented Feb 16, 2022

Custom xAxis, e.g., horizontal, line drawing has been implemented using following variables.

withCustomXAxis
customXAxisData

Following feature has been implemented here.
#582

Sample implementation:

const customXAxisData = {
        datasets: [
          {
            pts: 10,
            lineStyle: {
              stroke: Colors.brownGrey,
              strokeWidth: 2,
              strokeDasharray: '2, 4',
            },
          },
          {
            pts: 45.00,
            lineStyle: {
              stroke: Colors.appBlue,
              strokeWidth: 2,
            },
          },
        ],
      };
<LineChart
          data={data}
          width={screenWidth}
          height={240}
          chartConfig={chartConfig}
          withShadow={false}
          withInnerLines={false}
          yAxisInterval={10}
          withVerticalLines={false}
          withCustomXAxis
          customXAxisData={customXAxisData}
          style={{marginLeft: -16, marginTop: 16, marginRight: 16}}
          segments={5}
        />

Once it is merged, I shall add vertical line drawing part using the same architecture.

@geneshairzan
Copy link

ist implemented in master ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants