Skip to content

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