Skip to content

BarGroupChart : X tick label is not centered #46

Open
@aesteve

Description

@aesteve

As a very minimal reproducer :

import React, {Component} from 'react';
import { BarGroupChart } from 'react-d3-basic';


export default () => {
	const data = [{age: 10, populationHere: 50, populationThere: 75}, {age: 20, populationHere: 100, populationThere: 95}, {age: 30, populationHere: 120, populationThere: 65}];
	const chartSeries = [{field: "populationHere", name: "Population Here", color: 'red'}, {field: "populationThere", name: "Population There", color: 'blue'}];
	const x = d => d.age;
	return (
		<BarGroupChart
			width={1000}
			height={200}
			x={x}
			chartSeries={chartSeries}
			xScale="ordinal"
			xLabel="Population"
			showYGrid={false}
			showXGrid={false}
			data={data} />
	);
};

image

As you can see on the picture above, the label is not displayed in between the two bars, but abit too much to the right.

Are you aware of that ? Is this on purpose ? Can I change this behaviour somehow ?

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions