Question

On this chart: http://junklogic.com/dcjs/barpie/index-controls.html

I have legends that correspond to a severity rating in my sample JSON file, that represents a file I will be using in production. Severity is "1", "2" & "3".

I would like to know if there is a way that I can label these "High" "Medium" and "Low". Unfortunately the job requirement won't allow me to add anything to the JSON file. I am hoping I can add a condition somehow. Thank you.

Links to files:

javascript: http://junklogic.com/dcjs/barpie/js/threatgraphs.js

json: http://junklogic.com/dcjs/barpie/data/dashdata.json

Was it helpful?

Solution

You can simply add these labels in your data preprocessing step:

data.forEach( function(d) {
        d.malwareName   = d.malware_name;
        d.endpoint      = d.endpoint;
        d.date          = dateFormat.parse(d.date);
        d.severity      = d.severity == 1 ? "high" : (d.severity == 2 ? "medium" : "low");
    });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top