Git Product home page Git Product logo

Comments (3)

PovilasKorop avatar PovilasKorop commented on August 11, 2024

@tommiekn that could be a feature/bug in Chart.js library we use. Can you attach a screenshot/screencast how to reproduce?

from laravel-charts.

tommiekn avatar tommiekn commented on August 11, 2024

@PovilasKorop hi, i would avoid to attach a screenshot cause the chart is showing api endpoints.

Anyway is simply a chart where i know theres multiple voices with the same total result, and only one shows.

For reference, it should be working like this (this is an official Spotify Api chart):
In this example many records has 0 as result so while onmouse over it shows all of them.

Screen Shot 2020-05-09 at 11 54 07

Heres the chart code i am using:

$chart_options_request_endpoint = [
            'chart_title' => 'Number of Requests/Endpoint',
            'chart_type' => 'line',
            'report_type' => 'group_by_date',
            'model' => 'App\ApiLog',
            'conditions'            => [
                ['name' => 'name 1', 'condition' => 'url = "asd" and response = "200"', 'color' => 'black'],
                ['name' => 'name2', 'condition' => 'url = "asd1" and response = "200"', 'color' => 'green'],
['name' => 'name 3', 'condition' => 'url = "asd2" and response = "200"', 'color' => 'blue'],
            ],
            
            'group_by_field' => 'created_at',
            'group_by_period' => 'day',
            
            //'aggregate_function' => 'sum',
            //'aggregate_field' => 'id',
            
            
            'filter_field' => 'created_at',
            'filter_days' => 30, // show only transactions for last 30 days
            'filter_period' => 'month', // show only transactions for this week
            'continuous_time' => false, // show continuous timeline including dates without data
        ];
        

Thanks!

from laravel-charts.

tommiekn avatar tommiekn commented on August 11, 2024

I have checked Chart.js library docs and i believe what you miss is to specify the index value in the Chart.js options:

https://www.chartjs.org/docs/latest/general/interactions/modes.html#interaction-modes

You should add:

tooltips: {
    mode: 'point'
},

I have tested it and fix the issue, you have a pull request here #27

I would suggest to move these settings in the laravel charts options in a future, to allow basic personalizations between charts.

from laravel-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.