add link in legend text in fusion chart - html

How can I add link in legend text in fusion chart?
I tried below code but it is adding link in chart not on legend's text:
"data": [{
"label": "Workplace Services",
"value": "24",
"color": "#81cee3",
"link": "http://google.com" // added this
}]

For adding a link to the legend you need to use FusionCharts legendItemClicked API event, to know more check this link - https://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-events#legenditemclicked-97
Refer this snippet - "events": {
"legendItemClicked": function(eventObj, dataObj) {
if( eventObj.data.datasetName==="Food"){
window.location.href= "https://www.fusioncharts.com/dev/";
}
}
}

Related

How to show a color caption on the Vega Stacked Bar Chart?

I am using this chart: https://vega.github.io/vega/examples/stacked-bar-chart/
I want to show a color note for the chart below.
 But I can't find a solution to apply this type of chart. Do you have any solution for this type of chart?
I found the solution, just add Legend in.
"legends": [
{
"title": "% of Obese Adults",
"orient": "right",
"type": "symbol",
"fill": "color",
"format": ".1%",
"clipHeight": 16
}
],

How to link QnA Maker answer in Adaptive Card=

I'm rather new with these technologies so bear with me. I have successfully deployed Bot Framework and linked QnA Maker to it. I am using Adaptive Card for first response and i want images in that adaptive card to (when clicked) to generate answer from QnA Maker. How can i link these images to generate QnA Maker answer? Is there a way to just give it URL that would trigger QnA Maker?
You could use the data property in your Adaptive Card to send a message payload to the Bot, which would then trigger the QnA answer.
For example, in the data property, if you put something like 'How do I upload a file', so when the image is clicked, the payload will be 'How do I upload a file' and will be sent to the Bot, where the QnA service should respond in kind with the correct answer.
{
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "Image",
"style": "Person",
"url": "${creator.profileImage}",
"size": "Small",
"selectAction": {
"type": "Action.Submit",
"id": "image",
"title": "image",
"data": "show me the text 'image'"
}
}
],
"width": "auto"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}

AEM 6.1: How to get the warning icon in a cq:dialog

AEM 6.1: How to get the warning icon in a cq:dialog. Is it some xtype that would help? If it were a pop up then,
CQ.Ext.Msg.show({ "icon":CQ.Ext.MessageBox.WARNIN, }) helps
but for "cq:Dialog", How should one **
Display the warning icon
With the warning message in a cq:dialog.
"jcr:primaryType": "cq:Dialog",
"height": 240,
"title":CQ.I18n.getMessage("Activate Later"),
"id": CQ.Util.createId("cq-activate-later-dialog"),
"params": {
"_charset_":"utf-8"
},
"items": {
"jcr:primaryType": "cq:Panel",
"items": {
"jcr:primaryType": "cq:WidgetCollection",
**"warnMsg": {
"xtype": "displayfield",
"html":CQ.I18n.getMessage("my warning message here."),
"hideLabel":true,
"hidden":flagHidden,
"name":"warnMsg",
},**
"absTime": {
"xtype": "datetime",
"fieldLabel":CQ.I18n.getMessage("Activation Date"),
"name":"absTime",
"allowBlank": false
}
}
},
You can use the display field and specify the required output in the html property as shown below.
"warnMsg": {
"html": "<img style='vertical-align:middle;' src='/libs/cq/ui/widgets/themes/default/ext/window/icon-warning.gif'><div style='vertical-align:middle; display:inline;'>Warning</div>",
"xtype": "displayfield",
"hideLabel": true
}
A similar SO question has been answered here too.
This code removes the text from wrapping around the icon displayed
"warnMsg": {
"xtype": "dialogfieldset",
"hideLabel":true,
"hidden":flagHidden,
"html": "<div><img style='float:left; padding-right:10px' src='/libs/cq/ui/widgets/themes/default/ext/window/icon-warning.gif'></div><div style='font-size:12px; margin-left: 40px;'> Your text here</div>",
"title":"Warning",
"name":"warnMsg"
},

Parsing through JSON .. Gives undefined?

I have a very complex JSON and a snippet of it is below:
var designerJSON=
{
"nodes":
[
{
"NodeDefinition": {
"name": "Start",
"thumbnail": "Start.png",
"icon": "Start.png",
"info": "Entry point ",
"help": "Start point in your workflow.",
"workflow ": "Start",
"category": "Basic",
"ui": [
{
"label": "Entry point",
"category": "Help",
"componet": "label",
"type": "label"
}
]
},
"States": [
{
"start": "node1"
}
]
},.......
]
}
I would like to get the value of "start" in States. But I am stuck in the first step of entering into JSON. When I try
console.log(designerJSON["nodes"]);
I am getting Undefined.
I want the value of start. Wich is designerJSON["nodes"]["States"]["start"].
Can you help.
Thanks in advance
designerJSON["nodes"]["States"]["start"] won't do it.
designerJSON["nodes"] is a list, as is States, so you need to access individual items by index (or iteration).
In the example you have given you need to use this:
designerJSON['nodes'][0]['States'][0]['start']
or this (cleaner IMO):
designerJSON.nodes[0].States[0].start
You have an array in JSON.
instead of
designerJSON["nodes"]["States"]["start"]
use
designerJSON["nodes"][0]["States"][0]["start"]
ps. pay attention on how code is formatted in the topic.
pps. using brackets for accessing properties in js is "bad style" (due to js hint recommendations). better access those via dot, e.g:
designerJSON.nodes[0].States[0].start

Using Oracle UCM JSON data in fullcalendar?

Is there a way to fetch data from Oracle UCM's JSON option and use this in Full Calendar. I createed a service to return data from calendar data in UCM, and want to display the events using fullcalendar.
Here is an example feed that I get back:
"ResultSets": {
{
"SQLLMCal": {
"fields": [
{ "name": "SINGLE_ELEMENT" },
{ "name": "Start" },
{ "name": "SCHOOL_TYPE" },
{ "name": "SCHOOL_TYPE_ID" },
{ "name": "Title" },
{ "name": "ENTRY_SIDE_GROUP" }
],
"rows": [
[
"141",
"3/17/11 12:00 AM",
"Elementary",
"3",
"Big Burger",
"1"
]
]
}
}
}
Thanks, Ken
need to parse your own data using a custom events function:
http://arshaw.com/fullcalendar/docs/event_data/events_function/
Okay, great example of "problem exists between keyboard and chair"! I just had to stare at the documentation and the answer was right there.
In my code, I have the following:
events: function(callback) {
By definition, this MUST be
events: function(start, end, callback) {
Once I added the start and end parameters, everything worked perfectly.
Thank you Adam for pointing me the the right direction!
Ken