Git Product home page Git Product logo

Comments (4)

devdavidkarlsson avatar devdavidkarlsson commented on August 17, 2024

What you would like to set to enable custom domain is on line 245:

y.domain([
d3.min(yData),
d3.max(yData) + padding
]);

to:

y.domain([
d3.min(yData),
myDomainMax + padding
]);

from angular-charts.

chinmaymk avatar chinmaymk commented on August 17, 2024

I'm not sure I understand the problem here, could you point me to a use case where you need to set domain range manually ?

For 80% of the cases, default domain should work fine. As they are calculated on the basis of data you provide. Padding is just d3.max(yData) * 0.20 - added to keep the bars from touching top of the chart.

from angular-charts.

devdavidkarlsson avatar devdavidkarlsson commented on August 17, 2024

I can not recreate it using the plunker. So I suppose it is me providing it with some data that makes the d3 calculation freak out (feel free to close this isse).

The setup I am using is shown below. The data array is created from a string of numbers separated by newline, therefore i regex remove this and create a proper array of it, the console log looks allright though:

  var thisThrow = HistoryService.getThrow($stateParams.throwId);


  $scope.config = {
    title: 'Values in throw',
    tooltips: true,
    labels: false,
    mouseover: function() {},
    mouseout: function() {},
    click: function() {},
    legend: {
      display: true,
      //could be 'left, right'
      position: 'right'
    }
  };
  $scope.history = {
    data: [{
      x: '0',
      y: thisThrow.data.replace(/(\r\n|\n|\r)/gm,'').split(''),
      tooltip: 'this is tooltip'
    }]
  };

from angular-charts.

chinmaymk avatar chinmaymk commented on August 17, 2024

I guess, thisThrow.data.replace(/(\r\n|\n|\r)/gm,'').split('') this will return a string array. console it out and check. Try mapping it to Number like this thisThrow.data.replace(/(\r\n|\n|\r)/gm,'').split('').map(function(d) { return Number(d); });

from angular-charts.

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.