What is the process for integrating custom event information stored in the {} property of a highchart dataset into highcharts-vue?

Creating charts with Vue using JSON data passed into the :options tag has been my usual approach.

However, I am now experimenting with constructing a custom chart by utilizing the renderer and ren.path().attr().add() functions. The load function within the chart options prevents me from converting this setup into a JSON file.

THE CUSTOM CHART SETUP:

{
chart: {
    backgroundColor: 'white',
    width: 600,
    height: 200,
    borderWidth: 1,
    events: {
        load: function () {
            var ren = this.renderer,
                colors = Highcharts.getOptions().colors,
                rightArrow = ['M', 0, 0, 'L', 10, 0, 'L', 5, 5, 'M', 10, 0, 'L', 5, -5];
    ren.path(['M', 50, 100, 'L', 550, 100])
                .attr({
                'stroke-width': 3,
                                stroke: 'black',
                                dashstyle: 'solid'
                })
                .add();

  ren.text('0%', 50 , 150).add();
  ren.text('Peer Group 1', 50, 50).add();
  ren.text('20%', 150 , 150).add();
  ren.text('Peer Group 2', 150, 50).add();
  ren.text('40%', 250 , 150).add();
  ren.text('Peer Group 3', 250, 50).add();
  ren.text('60%', 350 , 150).add();
  ren.text('Peer Group 4', 350, 50).add();
  ren.text('80%', 450 , 150).add();
  ren.text('Peer Group 5', 450, 50).add();
  ren.text('100%', 550 , 150).add();

   ren.path(['M', 100, 80, 'L', 100, 120])
     .attr({'stroke-width': 3,stroke: 'black',dashstyle: 'solid'}).add();
   ren.path(['M', 200, 80, 'L', 200, 120])
     .attr({'stroke-width': 3,stroke: 'black',dashstyle: 'solid'}).add();
   ren.path(['M', 300, 80, 'L', 300, 120])
     .attr({'stroke-width': 3,stroke: 'black',dashstyle: 'solid'}).add();
   ren.path(['M', 400, 80, 'L', 400, 120])
     .attr({'stroke-width': 3,stroke: 'black',dashstyle: 'solid'}).add();
   ren.path(['M', 500, 80, 'L', 500, 120])
     .attr({'stroke-width': 3,stroke: 'black',dashstyle: 'solid'}).add();  

    ren.circle(150, 100, 9).attr({fill: '#0000FF',
            stroke: 'black','stroke-width': 0}).add();
 ren.text('20%', 140, 70).css({color: '#0000FF'}) .add();

        }
    }
},
title: {
    text: 'Highcharts export server overview',
    style: {
        color: 'black'
    }
}

}

You can view the working JSON structure in this link. I typically follow this format for loading JSON data into the tags as shown above.

Am I overlooking something? Is there an alternative method to import this type of data into Highcharts or convert it into JSON format?

Answer №1

Experiencing a similar issue, I was able to resolve it by utilizing the :callback attribute to invoke the load function

<highcharts ref="highcharts" :options="data" :callback="load" ></highcharts>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

multer - the file uploaded by the request is not defined

I've been working on an app with Node, Express, and multer for image uploads. However, after submitting the form, req.file is coming up as undefined. I've spent hours trying to troubleshoot this issue but haven't been able to pinpoint the pr ...

Firestore javascript query is returning empty results

Yesterday everything was working smoothly, but this morning it suddenly stopped moving forward. The Firestore query is not returning anything - no errors, no response. Surprisingly, the console displays the phone perfectly fine. Additionally, the phone n ...

What is the best method for encrypting a URL that contains AngularJS data?

Here is the URL that needs to be encrypted: <a class="btn btn-success btn-sm btn-block" href="@Url.Action("myAction", "myController")?Id={{repeat.Id}}&HistoryId={{repeat.HistoryId}}" ng-cloak>View History</a> I am seeking guidance on enc ...

Is there a way to locate the source or URL linked to a button on a form or webpage?

Currently, I am extracting data feeds from a webpage by clicking a button that is similar to the 'Login' button displayed on the following link: However, this button acts as a 'Download' request that initiates the download of a csv rep ...

Using VueJS to conditionally apply a class within a template

My current setup involves a template that generates cards for individual projects pulled from Firebase and stored in an array. <template> <div class="projects-wrapper"> <div class="individual-project" v-bind:key="proje ...

Storing an array in a file using Swift

In the process of developing an application, I have successfully implemented functionality to: Check for an internet connection; Receive a JSON file from the server and store the data in a file if the server is reachable; Read from the file if the connec ...

`Is there a way for Javascript to retrieve information sent from Python Flask's render_template() method?`

Issue: I am facing difficulties in retrieving and displaying the data that I send from Javascript code when the user visits the site's landing page. The data in question is a dataframe. Backend Python Code: from flask import Flask, render_template, ...

Having trouble accessing PDF files on Electron framework

Despite following the advice provided in similar questions' answers, such as including webPreferences: { plugins: true } in the options when creating a BrowserWindow instance, I am still encountering issues. Every attempt to open or view a PDF ...

Parsing Json data to text format using Python

I am looking to extract information from a JSON file available at https://deathsnacks.com/wf/data/voidtraders.json [{u'Node': u'Kronia Relay (Saturn)', u'NodeIndex': 0, u'ManifestIndex': 0, u'Manifest': No ...

Activate Gulp watcher to execute functions for individual files

I have developed a specific function that I need to execute only on the file that has been changed with gulp 4.0 watcher. For example, the current task setup looks like this: gulp.watch([ paths.sourceFolder + "/**/*.js", paths.sourceFolder + "/**/ ...

Processing JSON data with an extensive number of columns using Spark

Currently, I am working on a Proof of Concept for a Spark application written in Scala running in LOCAL mode. Our task involves processing a JSON dataset with an extensive 300 columns, though only a limited number of records. Utilizing Spark SQL has been s ...

My program is throwing an error due to invalid JSON format

Snippet of code: var data = $.parseJSON(data); Error message: Encountered Invalid JSON: {times: [{'9:30am','10:00am','10:30am','11:00am','11:30am','12:00pm','12:30pm','1:00pm&apo ...

Reading Properties in VueJS with Firebase

<template> <div id="app"> <h1 id="title"gt;{{ quiz.title }}</h1> <div id="ques" v-for="(question, index) in quiz.questions" :key="question.text"> <div v-show="index = ...

Encountering a Vue3/Vite/Vuetify 3 build issue: The variable was not declared with !default in the imported module

Struggling to implement SASS Variables in my Vue 3, Vuetify 3, Vite build as I keep running into an error regarding variables not being declared with !default Following the guidelines provided in theVuetify 3 documentation for configuring SASS Variables. ...

When running locally, the Web API functions as expected. However, once published, it

After successfully creating a Web API that returns data using AngularJS and displaying it on a local web page, I encountered an issue when I published the API to my web host. The error message "SyntaxError: JSON.parse: unexpected end of data at line 1 colu ...

What is the best way to combine an Angular project with an existing Node.js project?

I've successfully deployed my Angular project on Heroku and my Node.js API REST on Heroku as well. However, they are separate projects with different URLs but function together. Is there a way to combine them on the server and have just one URL? Curr ...

Maintain the markup created by jQuery inside the AJAX function called by setInterval

In the code snippet below, real-time markup is generated and automatically updates using the setInterval function. The markup includes buttons and hidden content within div elements. Each button reveals its corresponding div, but the div reverts to a hid ...

Store the value returned from either the URI or the response in the test context using Cypress IO

I am struggling to figure out how to extract a specific portion of a key from both the URL and the xhr response. I initially attempted using the URI method but couldn't specify to save only part of the value. .url().then(($url) => { co ...

Executing a Component function within an "inline-template" in VueJS

VueJS version 1.9.0 app.js require('./bootstrap'); window.Vue = require('vue'); Vue.component('mapbox', require('./components/mapbox.js')); const app = new Vue({ el: '#app' }); components/mapbox.js ...

Changing from system mode to dark mode or light mode

Within my Next.js web application, I am implementing MUI to facilitate the transition between system, light, and dark modes. Persistence between sessions is achieved by storing the selected theme in local storage. The user has the option to change the them ...