Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Answer Stackoverlow Question #230

Open
jamesleesaunders opened this issue Dec 1, 2022 · 0 comments
Open

Answer Stackoverlow Question #230

jamesleesaunders opened this issue Dec 1, 2022 · 0 comments
Labels
question Further information is requested

Comments

@jamesleesaunders
Copy link
Owner

I am trying to plot D3 X3D charts with points. A basic example uses a random set of them. I want to plot data from arrays, how to pass data to the variable "var myData"? For example, I have "1 2 3 4 5, 6 7 8 9 10" for axis variables.

<script>
    // Select chartholder
    var chartHolder = d3.select("#chartholder");

    // Declare the chart component
    var myChart = d3.x3d.chart.scatterPlot()
      .mappings({ x: 'x', y: 'y', z: 'z', size: 'size', color: 'color' })
      .colors(d3.schemeRdYlGn[8])
      .sizeRange([0.1, 1.5]);

    var refreshChart = function() {
      // Generate some data
      var myData = d3.x3d.randomData.dataset6(200);

      chartHolder.datum(myData).call(myChart);
    };

    d3.select("#refresh").attr("onclick", "refreshChart()");

    refreshChart();
</script> 

There is a good example for Bar charts. There we have Keys with [] holders. I want to make it here.

From:
https://stackoverflow.com/questions/73078754/how-to-load-array-data-into-d3-x3d-charts

@jamesleesaunders jamesleesaunders added the question Further information is requested label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant