Method of Creating a Widget with Non-datetime Type Data on the Horizontal Axis

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Method of Creating a Widget with Non-datetime Type Data on the Horizontal Axis

L1 Bithead

Hi,

I am considering setting non-datetime type data on the horizontal axis of a Widget.

However, it doesn't seem possible to create such a graph from the Widget creation screen.

 

If it is possible to create a graph using methods such as script-based creation, I would appreciate it if you could tell me how. I have checked the page at the following link, but I could not understand a specific solution.

 https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.5/Cortex-XSOAR-Administrator-Guide/Script-...

 

(This sentence is being translated by Chat-GPT.)

1 accepted solution

Accepted Solutions

L4 Transporter

Hi @MEiunyo1 ,

 

You need to create an automation with "widget" tag and from the dashboard menu please click + sign and select script. From this screen, you need to select the script that you developed. In the admin guide, there are sample scripts for each type. For your need, you can use the below structure and change the returned data.   For example, I changed the date with A,B,C,D,E.

data = [
    {"name": "2018-04-12", "data": [10], "groups": [{"name": "Unclassified", "data": [10] }]},
    {"name": "2018-04-10", "data": [3], "groups": [{"name": "Unclassified", "data": [2] }, {"name": "Access", "data": [1] }]},
    {"name": "2018-04-17", "data": [1], "groups": [{"name": "Unclassified", "data": [1] }]},
    {"name": "2018-04-16", "data": [34], "groups": [{"name": "Unclassified", "data": [18] }, {"name": "Phishing", "data": [14] }]},
    {"name": "2018-04-15", "data": [17], "groups": [{"name": "Access", "data": [17] }]}
];
demisto.results(json.dumps(data));

 

gyldz_0-1728375501951.png

https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.10/Cortex-XSOAR-Administrator-Guide/Script...

View solution in original post

2 REPLIES 2

L4 Transporter

Hi @MEiunyo1 ,

 

You need to create an automation with "widget" tag and from the dashboard menu please click + sign and select script. From this screen, you need to select the script that you developed. In the admin guide, there are sample scripts for each type. For your need, you can use the below structure and change the returned data.   For example, I changed the date with A,B,C,D,E.

data = [
    {"name": "2018-04-12", "data": [10], "groups": [{"name": "Unclassified", "data": [10] }]},
    {"name": "2018-04-10", "data": [3], "groups": [{"name": "Unclassified", "data": [2] }, {"name": "Access", "data": [1] }]},
    {"name": "2018-04-17", "data": [1], "groups": [{"name": "Unclassified", "data": [1] }]},
    {"name": "2018-04-16", "data": [34], "groups": [{"name": "Unclassified", "data": [18] }, {"name": "Phishing", "data": [14] }]},
    {"name": "2018-04-15", "data": [17], "groups": [{"name": "Access", "data": [17] }]}
];
demisto.results(json.dumps(data));

 

gyldz_0-1728375501951.png

https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.10/Cortex-XSOAR-Administrator-Guide/Script...

Hi, @gyldz .

Thank you for your wonderful reply.

 

So you can create such graphs using scripts.
I'll look into the scripts for creating the graphs I want to make right away.

  • 1 accepted solution
  • 627 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!