Giter Club home page Giter Club logo

devstratum-jqp-graph's Introduction

Devstratum JQP Graph

jQuery plugin for render simple html block graphs

Article

https://devstratum.ru/software/devstratum-jqp-graph-vizualizatsiya-grafikov

Usage

Include jQuery library

<script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript"></script>

Include local script files in html doc

<link href="css/jquery.dvstr_jqp_graph.css" rel="stylesheet" type="text/css"/>
<script src="js/jquery.dvstr_jqp_graph.js" type="text/javascript"></script>

Example

screenshot of sample

<div class="graph-conatainer" id="graph_01"></div>
<script>
    jQuery(document).ready(function($) {
        var color_blue = '#4c8ffc';
        var color_green = '#4f9100';
        var color_orange = '#e76100';

        $('#graph_01').dvstr_graph({
            title: '3DMark 2.7.6',
            description: 'Fire Strike 1920 x 1080 (Radeon RX 470 4GB)',
            unit: 'Score',
            better: 'Higher is better',
            separate: false,
            grid_wmax: 10000,
            grid_part: 10,
            points: [
                {
                    title: 'Combined',
                    color: color_blue
                },
                {
                    title: 'CPU',
                    color: color_green
                },
                {
                    title: 'Overall',
                    color: color_orange
                }
            ],
            graphs: [
                {
                    label: 'Phenom II X6 1055T',
                    color: [
                        color_blue,
                        color_green,
                        color_orange
                    ],
                    value: [
                        3069,
                        5999,
                        8252,
                    ]
                },
                {
                    label: 'Xeon E5450',
                    color: [
                        color_blue,
                        color_green,
                        color_orange
                    ],
                    value: [
                        2863,
                        5120,
                        7927,
                    ]
                },
                {
                    label: 'Core i5-3470',
                    color: [
                        color_blue,
                        color_green,
                        color_orange
                    ],
                    value: [
                        4047,
                        6489,
                        9143,
                    ]
                }
            ]
        });
    });
</script>

screenshot of sample

<div class="graph__block" id="graph_02"></div>
<script>
    jQuery(document).ready(function($) {
        var color_blue = '#4c8ffc';
        var color_red = '#cc0000';

        $('#graph_02').dvstr_graph({
            title: 'Blender 2.79b',
            unit: 'Seconds',
            better: 'Lower is better',
            type: 'time',
            points: [
                {
                    title: 'Samples 150',
                    color: color_blue
                },
                {
                    title: 'Samples 600',
                    color: color_red
                }
            ],
            graphs: [
                {
                    label: 'Phenom II X6 1055T',
                    color: [
                        color_blue,
                        color_red
                    ],
                    value: [
                        '02:19',
                        '09:09'
                    ]
                },
                {
                    label: 'Xeon E5450',
                    color: [
                        color_blue,
                        color_red
                    ],
                    value: [
                        '03:07',
                        '12:22'
                    ]
                },
                {
                    label: 'Core i5-3470',
                    color: [
                        color_blue,
                        color_red
                    ],
                    value: [
                        '01:28',
                        '05:48'
                    ]
                }
            ]
        });
    });
</script>

Options

title

  • Type: string
  • Default: none
  • Graph name

description

  • Type: string
  • Default: none
  • Graph description

unit

  • Type: string
  • Default: none
  • Unit

better

  • Type: string
  • Default: none
  • Which values are better, higher or lower

type

  • Type: string
  • Default: number
  • Data type, number or time

separate

  • Type: boolean
  • Default: false
  • Separating the output of graph rows

grid_wmax

  • Type: int
  • Default: 0
  • Maximum range of graph grid units

grid_part

  • Type: int
  • Default: 5
  • Number of parts of grid graph

points

  • Type: object
  • Default: none
  • An object of points of different dimensions of the graph with the parameters of names and colors

graphs

  • Type: object
  • Default: none
  • Graph Row Object with Label, Colors and Value Parameters

Info

Version: 1.0

License: GNU General Public License v3.0

Author: Sergey Osipov

Website: https://devstratum.ru

Email: [email protected]

Repo: https://github.com/devstratum/Devstratum-JQP-Graph

devstratum-jqp-graph's People

Contributors

devstratum avatar

Stargazers

 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.