Cookie Consent by Free Privacy Policy Generator Aktuallisiere deine Cookie Einstellungen ๐Ÿ“Œ How to obtain the relative position of brush in the coordinate system in the vchart chart library?


๐Ÿ“š How to obtain the relative position of brush in the coordinate system in the vchart chart library?


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

Question title

How to obtain the relative position of brush in the coordinate system in the vchart chart library?

Problem description

When I was using the vchart library, I encountered a problem. I listened to the onBrushEnd event and wanted to obtain the relative position of the area selected by the brush in the coordinate system. That is, after I drew a frame on the chart, I wanted to obtain the position range of this area on the x/y axis. I tried all the methods I could think of, but did not find the corresponding data.

Image description

Solution

According to the design and usage of vchart, currently the vchart API does not directly provide this information, but it is still possible to obtain this necessary information through some other means. The specific steps are as follows:

  1. Use vchart.getAllComponents () to find the brush component

Image description

  1. In the brush component, there is a property called _brushComponent. AABBBounds , which is the relative position of the checkbox in the region.

Image description

  1. Similarly, with the vchart.getAllComponents () method, we can find the components for the x and y axes.

Image description

  1. In the found axis component, we can use the _scale .invert (position) method to convert the position of AABBBounds obtained in the previous step to specific values on the x and y axes.

In order to prevent a very small position shift when the user clicks and accidentally triggers the brush drawing, we can also set a sizeThreshold property for the brush. This property means the checkbox size threshold, which literally means the minimum size of the box you need to draw. The brush event will only be triggered when the size of the box is greater than this threshold.

Related Documents

...



๐Ÿ“Œ How to obtain the relative position of brush in the coordinate system in the vchart chart library?


๐Ÿ“ˆ 147.1 Punkte

๐Ÿ“Œ UTM Coordinate Converter 2.0.4 - Convert between various geographic coordinate systems.


๐Ÿ“ˆ 48.83 Punkte

๐Ÿ“Œ Krita 4.2.9 released! More stability, more features in Color Smudge brush engine, better brush outline and more!


๐Ÿ“ˆ 43.81 Punkte

๐Ÿ“Œ Abnormal Y-axis display in the area chart of vchart library, where lower values appear higher


๐Ÿ“ˆ 43.36 Punkte

๐Ÿ“Œ How to implement hover effect on points in vchart chart library?


๐Ÿ“ˆ 43.36 Punkte

๐Ÿ“Œ How to customize radar chart axis labels to richtext in VChart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ VChart, How to center the label of a bar chart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ How to customize the labels of a pie chart in VChart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ Can we limit the default rendered lines in a vchart multi-line chart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ How to align bar chart labels to the left and keep their styles consistent in @visactor/vchart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ How to configure the Y-axis with both title and unit in the VChart line chart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ What are the methods for formatting VChart chart labels?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ How to configure pie chart size in VChart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ How to configure vchart line chart to make the points sparse in the case of big data?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ How to set the bar width of a bar chart in VChart


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ Does VChart's multi-group bar chart support multi-layer axis labels?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ How to bind the click event of the pie chart label in @visactor/vchart?


๐Ÿ“ˆ 35.94 Punkte

๐Ÿ“Œ Issues with x-axis data overlap and y-axis data not being displayed when using vchart library


๐Ÿ“ˆ 28.96 Punkte

๐Ÿ“Œ Low CVE-2020-15944: Gantt-chart project Gantt-chart


๐Ÿ“ˆ 28.81 Punkte

๐Ÿ“Œ Medium CVE-2020-15943: Gantt-chart project Gantt-chart


๐Ÿ“ˆ 28.81 Punkte

๐Ÿ“Œ How to use Chart.js to create a Chart for Your Project


๐Ÿ“ˆ 28.81 Punkte

๐Ÿ“Œ How to position the chart at the far left of the canvas?


๐Ÿ“ˆ 28.29 Punkte

๐Ÿ“Œ Text Style Brush: Facebook zeigt KI-System fรผr Deep-Fake-Schriften


๐Ÿ“ˆ 26.05 Punkte

๐Ÿ“Œ Coordinate your next attack with $6 off the ONIKUMA K8 Gaming Headset


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ Coordinate Plus App up to 1.0.2 on Android/iOS SSL Certificate Validator weak authentication


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ Mozilla Firefox up to 79.x Coordinate information disclosure


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ CVE-2015-8219 | FFmpeg up to 2.8.1 JPEG 2000 Data libavcodec/jpeg2000dec.c init_tile coordinate input validation (BID-77640 / ID 87178)


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ Revisiting 2b2t Tamed Animal Coordinate Exploit


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ Coordinate Compression


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ Coordinate events and schedule meetings across different time zones with World Clock Pro


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ Tech Firms Coordinate Disclosure of New Meltdown, Spectre Flaws


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ geotiff.js: How to Get Projected Data for a Latitude-Longitude Coordinate


๐Ÿ“ˆ 24.42 Punkte

๐Ÿ“Œ UN sets up advisory team to coordinate 'inclusive' AI governance


๐Ÿ“ˆ 24.42 Punkte











matomo