Chart
A chart component visually represents data, such as bar, line, or pie charts. It takes in data and configuration props (labels, values, colors) and renders a chart.
Basic
Charts are used to display data in a clear and concise manner. They are ideal for presenting information in a visually appealing and easy-to-understand format.
Sales
Installation
If you hit any issues, make sure you check out the installation guide here.
Manual Installation
Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.
And next, you can copy the code below and paste it into your dopest component folder.
Anatomy
Import the components and use them as shown below, adapting the structure to fit each component.
Colors
If you're working on an existing project, you can use these variables. However, if you've just installed Justd, they will already be included during project initialization. You can also customize chart colors, check out the theme page for more options.
Tooltip
Tooltips are used to provide additional information about a chart element when the user hovers over it. They can be used to display additional details, such as the value of a data point, or to provide context about the data.
Legend
Legends are used to display a list of labels for different chart elements. They can be used to provide context about the data and help the user understand the meaning of different colors and shapes.
BarChart
could be replaced with any other chart component like PieChart
, LineChart
, etc.
Area Chart
Used to show changes over time, the area chart highlights both trends and volume, with the filled area showing the magnitude of change. It’s useful when you want to emphasize total growth or decline.
Basic
Area Chart
Stacked
Area Chart - Stacked
Linear
Area Chart - Linear
Gradient
Area Chart - Gradient
Bar Chart
Bar charts are perfect for comparing different categories. The lengths of the bars make it easy to compare quantities side by side, showing differences between groups clearly.
Basic
Bar Chart
Horizontal
Bar Chart - Horizontal
Multiple
Bar Chart - Multiple
Custom Label
Bar Chart - Custom Label
Mixed
Bar Chart - Mixed
Line Chart
A line chart is used to display data points connected by a straight line, showing trends or changes over time. It's ideal for visualizing continuous data, especially when you want to emphasize the direction of change (upward or downward trends) over a period.
Basic
Line Chart
Multiple
Line Chart - Multiple
Dots
Line Chart - Dots
Dots Color
Line Chart - Dots Colors
Custom Label
Line Chart - Label
Linear
Line Chart - Linear
Pie Chart
A pie chart divides data into proportional slices to represent parts of a whole. It's ideal for displaying relative sizes of categories, especially when you need a visual comparison of percentages.
Basic
Pie Chart
Interactive
Pie Chart - Interactive
Label
Pie Chart - Label
Stacked
Pie Chart - Stacked
Radar Chart
Radar charts display multiple variables in relation to a central point, allowing you to compare several categories at once. It's useful for visualizing performance, skills, or capabilities across multiple metrics.
Basic
Radar Chart
Multiple
Radar Chart - Multiple
Dots
Radar Chart - Dots
Icon
Radar Chart - Icons
Line Only
Radar Chart - Lines Only
Radial Chart
A radial chart is a circular graph where data points are plotted in a circular arrangement around a central point, radiating outwards. It’s used to display multivariate data where multiple variables are compared on the same scale. Radial charts help in visualizing relationships between different data points and often make it easier to see overall patterns or outliers in the data.
Basic
Radial Chart
Grid
Radial Chart - Grid
Stacked
Radial Chart - Stacked
Text
Radial Chart - Text
Shape
Radial Chart - Shape
Radial
Radial charts are a type of chart that displays data in a circular format. They are often used to visualize data that is spread out in a circular pattern, such as the distribution of sales across different regions or the concentration of customers in different areas.
Basic
Radial Chart
Grid
Radial Chart - Grid
Stacked
Radial Chart - Stacked
Text
Radial Chart - Text
Shape
Radial Chart - Shape
Accessibility
For accessibility purposes, you can add the accessibilityLayer
prop to the chart component. This will add a role="img"
to the chart, which will make it accessible to screen readers.