-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jose C Quintas Jr <juniorquintas@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com>
- Loading branch information
Showing
30 changed files
with
107 additions
and
87 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
title: Charts - Highlighting | ||
productId: x-charts | ||
components: ChartsAxisHighlight | ||
--- | ||
|
||
# Charts - Highlighting | ||
|
||
<p class="description">Highlighting data offers quick visual feedback for chart users.</p> | ||
|
||
It can be used to emphasize a specific data point or series, or to fade out the rest of the chart. | ||
And it can be controlled by the user or synchronized across multiple charts. | ||
|
||
## Highlighting | ||
|
||
### Highlighting axis | ||
|
||
You can highlight data based on mouse position. | ||
By default, those highlights are lines, but it can also be a vertical band if your x-axis use `scaleType: 'band'`. | ||
|
||
On the chart, to customize this behavior, you can use: | ||
|
||
```jsx | ||
axisHighlight={{ | ||
x: 'line', // Or 'none', or 'band' | ||
y: 'line', // Or 'none' | ||
}} | ||
``` | ||
|
||
{{"demo": "BandHighlight.js" }} | ||
|
||
### Highlighting series | ||
|
||
In parallel with the tooltip, you can highlight and fade elements. | ||
|
||
This kind of interaction is controlled by series properties `highlightScope` which contains two options: | ||
|
||
- `highlighted` Indicates which item to highlight. Its value can be | ||
- `'none'` Do nothing (default one). | ||
- `'item'` Only highlight the item itself. | ||
- `'series'` Highlight all items of the series. | ||
- `faded` Indicates which item to fade (if they are not already highlighted). Its value can be | ||
- `'none'` Do nothing (default one). | ||
- `'series'` Fade all the items of the series. | ||
- `'global'` Fade all the items of the chart. | ||
|
||
{{"demo": "ElementHighlights.js"}} | ||
|
||
### Controlled highlight | ||
|
||
The highlight can be controlled by the user when they set `highlightedItem` and `onHighlightChange`. | ||
|
||
You can set the `highlightedItem` value based on inputs, and sync it when the user hover over an item themselves. | ||
|
||
{{"demo": "ControlledHighlight.js"}} | ||
|
||
#### Synchronizing highlights | ||
|
||
Having a controlled highlight allows you to control it in multiple charts at the same time. | ||
You need to ensure that the `series` has the same `ids` and the data is in the same order. | ||
|
||
{{"demo": "SyncHighlight.js"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import * as pageProps from 'docsx/data/charts/highlighting/highlighting.md?muiMarkdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs {...pageProps} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters