OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Report line chart error

This topic contains 13 replies, has 2 voices, and was last updated by  Mike Kudelya 7 years, 6 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #25263

    abel
    Participant

    I have create my entity with some column and join column.
    When I create segment, it’s ok.
    When I create report, result in table grid is correctly, but line chart fail
    This is image:

    In chart, my label and value are column not join column. My label is “doc_date” and my value is “amount”. I was group by doc_date.
    What problem here?
    P/s: When I change chart_options in database, field “name”:”bar_chart” replace “name”:”line_chart”. The chart show 2 column, but not have label of vertical and horizontal, and not have date (horizontal)

Viewing 13 replies - 1 through 13 (of 13 total)
  • Author
    Replies
  • #25264

    abel
    Participant

    Another issue same that issue.
    When I create report for Magento Shipping Cart (with sample data) include:
    – Column: created_at and amount(SUM)
    – Group by: created_at
    – Line chart: X-created_at and Y-amount
    – No filter
    ==> It’s work fine, except chart (problem with line X)

    But when I add filter for created_at column, the chart are as same as photo above.

    What problem here?

    #25265

    Mike Kudelya
    Participant

    Hi,

    It seems all the values have the same date value. I have updated created_at on one value and got photo above.

    #25266

    abel
    Participant

    But in table report, it’s have 2 different date.
    And as same as in sample data

    #25267

    Mike Kudelya
    Participant

    Probably this is the bug. If you try to add 3-5 different dates, problem will dissapear, right?

    #25268

    abel
    Participant

    Yes, it is.
    But why, with magento shopping cart (sample data). When I create report with 1 day => no show chart, with 2 days => chart is ok. What different?
    (Same in group by and filter, group by date, and sum amount)

    #25269

    Mike Kudelya
    Participant

    Hi,

    I have created task for the issue, thanks! As temporary solution you can replace this piece of code to:

    #25270

    abel
    Participant

    Thanks for answer :)
    I have 1 more question. I was created and used javascript, follow document in orocrm.com
    That’s my code:
    1. In direct mybundle/resources/public/js:
    – File Chart.min.js
    – In direct ../app/components, I have file test-chart.js with code

    2. In requirejs.yml:

    3. In template file:

    But why, when I call template, it’s not call this js. I already try

    What wrong here?

    #25271

    Mike Kudelya
    Participant

    Hi,

    I have just created a similar component and it works.

    Did you run these commands

    ?

    #25272

    abel
    Participant

    Yes, I was run these commands. All file in folder Resource/public was updated in web/bundles/…
    But it’s not working

    #25273

    Mike Kudelya
    Participant

    Hi,

    I have created src/Custom/Bundle/OroBundle/Resources/public/js/app/components/test.js:

    src/Custom/Bundle/OroBundle/Resources/config/requirejs.yml:

    and write this code after ‘{% block content_data %}’ in vendor/oro/crm/src/OroCRM/Bundle/SalesBundle/Resources/views/Lead/view.html.twig:

    It works! Are you sure that your template is rendering ? Put your <div> in existed code, for example lead view page. will be work or not?

    #25274

    abel
    Participant

    My template already show (when I check inspect, in my template have <div> and <canvas> tag).
    But it’s not work :(

    #25275

    abel
    Participant

    Update!
    I was used this js for different template, then it’s work fine …
    The different between 2 template is:
    – Template non working:
    + No extend exist template
    + Data return from controller

    – Template working:
    + Extend action update.html.twig, I call js in 1 block
    + Data return from controller

    So, what happened there?

    #25276

    Mike Kudelya
    Participant

    Hi,

    You have two ways to resolve this problem:

    first: using standard templates (with oro header, buttons, etc..), like lead view and extend it from OroUIBundle:actions:view.html.twig
    second: use empty page, initialize ComponentManager and run your component.

    Here is an example of second variant:

Viewing 13 replies - 1 through 13 (of 13 total)

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top