Giter Site home page Giter Site logo

daoos / extjsd3charts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jmcdonald69124/extjsd3charts

0.0 1.0 0.0 344 KB

If you are into data visualization and developing in JavaScript then you have probably heard of d3js which can be found at d3js.org, you may not have heard about NVD3 which is a nice open source group of reusable charts based on d3js created by developers for the financial industry. You can find NVD3 here http://nvd3.org/ . What these two chart packages do is allow you, the developer, to control every last pixel on the screen. You are also left with code that can be moved away from Extjs if that day comes. Just take a look at the examples page to realize how many possibilities there are when it comes to charting: https://github.com/mbostock/d3/wiki/Gallery. I needed to get that type of flexibility in my application and I liked the crisp sharp lines so I went ahead and threw together some NVD3 / D3 based widgets that you can use in your applications by simply adding them and referencing the xtype. I am assuming that you will be using extjs 5 so the instructions here are for installation in an extjs5 application – that said they should work with extjs4 as well.

JavaScript 70.37% HTML 2.32% CSS 27.19% Ruby 0.11%

extjsd3charts's Introduction

ExtjsD3Charts

If you are into data visualization and developing in JavaScript then you have probably heard of d3js which can be found at d3js.org, you may not have heard about NVD3 which is a nice open source group of reusable charts based on d3js created by developers for the financial industry. You can find NVD3 here http://nvd3.org/ . What these two chart packages do is allow you, the developer, to control every last pixel on the screen. You are also left with code that can be moved away from Extjs if that day comes. Just take a look at the examples page to realize how many possibilities there are when it comes to charting: https://github.com/mbostock/d3/wiki/Gallery. I needed to get that type of flexibility in my application and I liked the crisp sharp lines so I went ahead and threw together some NVD3 / D3 based widgets that you can use in your applications by simply adding them and referencing the xtype. I am assuming that you will be using extjs 5 so the instructions here are for installation in an extjs5 application – that said they should work with extjs4 as well.

Before you get started

Check out the article on my blog <a href="http://www.learnsomethings.com" target=""_blank">www.learnsomethings.com

Getting Started:

Add d3 and nv.d3 to your build.

  • First download d3.min.js and nv.d3.min.js.
  • Create a folder named js under your resources folder
  • Place the files in the new js folder
  • Change the lines in your app.json file below to include the new js files into your build
    "js": [
        {
            "path": "app.js",
            "bundle": true
        },{
            "path": "resources/js/d3.min.js",
            "bundle": false
        },{
            "path": "resources/js/nv.d3.min.js",
            "bundle": false
        }
    ],

Add nv.d3.min.css to your application

  • Download the nvd3 css file
  • Create a folder named css under your resources folder
  • Place the file in the new css folder
  • Change the lines in your app.json file below to include the new css files into your build
    "css": [
        {
            "path": "bootstrap.css",
            "bootstrap": true
        },{
            "path": "resources/css/nv.d3.css",
            "bootstrap": false
        }
    ],

Create a widget folder at the same level as the app folder.

D3Donutpanel

Config options

  • dataUrl : (string) - url of json data for the chart, json should be in the following format, label and value are required, any attached data points will get passed to the click event i.e. primary keys etc ..
    {'results': 1, 'data':[{'some_value': 'not required', 'label': 'Required', 'value': 17}]}
  • chartTitle : (string) - chart title displayed above the chart
  • tooltipAppend : (string) - text to append to the tooltip value
  • showTotal : (boolean) - show total in the center of the chart
  • totalType : ‘sum’ or ‘avg’ calculate the total values as the sum of all values that are shown or the average of all shown values.

extjsd3charts's People

Contributors

jmcdonald69124 avatar

Watchers

liushouquan avatar

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.