Giter Site home page Giter Site logo

Comments (3)

ae3e avatar ae3e commented on August 13, 2024 1

This issue is not related to ae3e-plolty-plugin but here is an example using the Grafana (Radnom Walk) data source and https://plotly.com/javascript/violin/.

Data

[
  {
    "type": "violin",
    "points": "none",
    "box": {
      "visible": true
    },
    "boxpoints": false,
    "line": {
      "color": "black"
    },
    "fillcolor": "#8dd3c7",
    "opacity": 0.6,
    "meanline": {
      "visible": true
    },
    "x0": "Total Bill"
  }
]

Layout

{
  "font": {
    "color": "darkgrey"
  },
  "paper_bgcolor": "rgba(0,0,0,0)",
  "plot_bgcolor": "rgba(0,0,0,0)",
  "margin": {
    "t": 30,
    "b": 20
  }
}

Script

var trace = {
  y: Array.from(data.series[0].fields[1].values.toArray())
};
return {data:[trace],layout:{title:'My Chart'}};

Result
image

Hope it helps

from ae3e-plotly-panel.

ae3e avatar ae3e commented on August 13, 2024

Not sure I understand. Are you able to create your desired chart only with Plotly (in a code playground) with sample data?
If it's only related to Plotly, you should check Plotly documentation first. Otherwise, please give an example with some code.

from ae3e-plotly-panel.

mbarradas avatar mbarradas commented on August 13, 2024

Hi sorry for now writing back in the previous weeks I had an accident and was not able to type on a computer for a couple of weeks.

I'm trying to do Violin charts as described on https://plotly.com/javascript/violin/.

I would like to group the data by a column and display a violin for each of the distinct values of that column.

It seems to me that the grouping is done with these lines on the examples I'm following

`Plotly.d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv", function(err, rows){

function unpack(rows, key) {
return rows.map(function(row) { return row[key]; });
}

var data = [{
type: 'violin',
x: unpack(rows, 'day'),
y: unpack(rows, 'total_bill'),
points: 'none',
box: {
visible: true
},`

I now that the unpack function is doing the job but I donΒ΄t seem to be capable of adapting it to the data array that the panel exposes.

I'm not fluent on JavaScript and appreciate any help that you could provide.

from ae3e-plotly-panel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.