Show label on the top of bar2d by fusioncharts - fusioncharts

How can I show label on the top of the line in the bar2d graphic?
For example:
|-------------------------
| This is line!
|================= 70%
|
| This is line 2!
|====== 30%
|-------------------------
Thanks.

Natively, FusionCharts does not support this feature. However, what makes FusionCharts really amazing is the number of workaround or tweaks you can come up with to address an issue (makes my job easier too :)
Please try out the following XML snippet using a Single series Bar 2D chart.
<?xml version="1.0" encoding="UTF-8"?>
<chart caption="Monthly Unit Sales" xAxisName="Month" yAxisName="Units" showValues="1" decimals="0" formatNumberScale="0" chartRightMargin="30">
<set label="" value="0" alpha="0.1" displayValue="
Feb" />
<set label="" value="857" />
<set label="" value="0" alpha="0.1" displayValue="
Apr" />
<set label="" value="494" />
</chart>
What we have done here is used empty and invisible data-plot above the data-plots we want to showcase with the Label on top. Thereby, using the displayValue attribute in the invisible data-plot, we can recreate the visual effect of the Labels being on-top of the data-plot being displayed.
Note: The character &#10; (new line break) has been used to bring the output of the displayValue attribute, i.e. the apparent Label in this case, closer to the data-plot below.
Alternatively, you may also use the Multi-series Bar 2D chart to re-create the above mentioned effect, using the XML snippet quoted below.
<?xml version="1.0" encoding="UTF-8"?>
<chart palette="2" caption="Business Results: 2005" yaxisname="Revenue (Millions)" hovercapbg="FFFFFF" toolTipBorder="889E6D" divLineColor="999999" divLineAlpha="80" showShadow="0" canvasBgColor="FEFEFE" canvasBaseColor="FEFEFE" canvasBaseAlpha="50" divLineIsDashed="1" divLineDashLen="1" divLineDashGap="2" numberPrefix="$" numberSuffix="M" chartRightMargin="30" useRoundEdges="1" legendBorderAlpha="0">
<categories>
<category label="" />
<category label="" />
<category label="" />
</categories>
<dataset seriesname="Domestic" color="8EAC41">
<set value="0" alpha="0.1" displayValue="Hardware" />
<set value="0" alpha="0.1" displayValue="Software" />
<set value="0" alpha="0.1" displayValue="Service" />
</dataset>
<dataset seriesname="International" color="607142">
<set value="116" />
<set value="237" />
<set value="83" />
</dataset>
</chart>
I hope this helps. :D

Related

Office Js: avoid doubling "&" symbol on ribbon button tooltip

I am developing a Word addin with Office-js. I want to create a button in my ribbon. This button's name and tooltip should be AAA & BBB.
So, I developed the following part of the xml manifest.
<Group id="XXX.GrpYYY">
<Label resid="XXX.GrpYYY.Label"/>
<Icon>...</Icon>
<Control xsi:type="Button" id="XXX.BtnYYY">
<Label resid="XXX.BtnYYY.Label" />
<Supertip>
<Title resid="XXX.BtnYYY.Label" />
<Description resid="XXX.BtnYYY.Tooltip" />
</Supertip>
<Icon>...</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="XXX.YYY.SL" />
</Action>
</Control>
</Group>
And this is the relevant part of the Resources in the xml manifest:
<bt:ShortStrings>
...
<bt:String id="XXX.GrpYYY.Label" DefaultValue="MY GROUP" />
...
<bt:String id="XXX.BtnYYY.Label" DefaultValue="AAA & BBB" />
...
</bt:ShortStrings>
<bt:LongStrings>
...
<bt:String id="XXX.BtnYYY.Tooltip" DefaultValue="AAA & BBB" />
...
</bt:LongStrings>
This is the result:
As you can see the & symbol in the tooltip is doubled.
Is it a bug or am I doing something wrong? Is there a way to avoid doubling this symbol?

De-mystifying allowed values for a field in Azure DevOps based on values of another field or Rules?

When you create a work item such as Bug in Azure devops, the values that you would see in the drop down of say Reason field would depend on the value you select for State field. For e.g. see these screenshots (Template Agile, no customizations)
Then if you change the state, the allowed values change as shown
To make matters more confusing, these are just few of the values that are returned by the documented REST API
The given API returns
"defaultValue": null,
"allowedValues": [
"Verified",
"Not fixed",
"Test Failed",
"As Designed",
"Cannot Reproduce",
"Copied to Backlog",
"Deferred",
"Duplicate",
"Fixed and verified",
"Obsolete",
"Fixed",
"Investigation Complete",
"Approved",
"Investigate",
"Resolved in error",
"Reactivated",
"Regression",
"Build Failure",
"New"
],
"helpText": "The reason why the bug is in the current state",
"alwaysRequired": false,
"dependentFields": [
{
"referenceName": "System.State",
"name": "State",
"url": "https://dev.azure.com/nikhil/_apis/wit/fields/System.State"
},
{
"referenceName": "Microsoft.VSTS.Common.ResolvedReason",
"name": "Resolved Reason",
"url": "https://dev.azure.com/nikhil/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason"
}
],
"referenceName": "System.Reason",
"name": "Reason",
"url": "https://dev.azure.com/{project}/{templateid}/_apis/wit/fields/System.Reason"
},
I am trying to figure out the right API or set of APIs that help demystify when to show what in the combo boxes, when to mark them read-only and when to let the user edit them.
The Resolved Reason Field is further interesting. For most parts it seems to simply copy the value from the Reason field, however the Rules API (see below) does not indicate this behaviour. It looks like what the Rules API returns does not match the behaviour that this field exhibits.
There is a concept of Rules mentioned in the REST API here - https://learn.microsoft.com/en-us/rest/api/azure/devops/processes/rules/get?view=azure-devops-rest-5.1#processrule
However this does not seem to give rules which specifically control "allowedValues" for fields based on value of another field as I explained above.
Question:
Is there an API that can give a comprehensive set of rules for fields on a work item types including their allowedValues? For e.g. the Reason or Resolved Reason field depending on the choice of State field as shown above?
Is there an API that can give a comprehensive set of rules for fields
on a work item types including their allowedValues? For e.g. the
Reason or Resolved Reason field depending on the choice of State field
as shown above?
First of all, I need to say, no, there is no such REST API to get the Reason value which depending on the State filed chosen. Since these are all not be documented, the best way for us to verify it is using the Fiddler trace(Fiddler can record all internet data between web application and internet).
[As example, here I will use Bug work item to show that.]
First, clear all the records in Fiddler => open the Bug work item in Azure Devops => press F12 in Fiddler to start record the data.
Change the work item state in Azure Devops(Note: just change, do not save it. "Save" belong to another operation). Then go Fiddler to see its internet records:
You will see that there only 2 event API, and these API are only used to post the action sign but not operate it. See the request body of first POST Event API:
You can see that it just used to post a sign about the State field has changed. That's why I say that there's no API to get the Reason value which depending on the State filed chosen, because our develop team did not use the script with API to achieve that.
Now, you should be very confusing that who is this action message to be sent to? Since the Reason field value listed is not controlled by the api, then who is in control?
The answer is XML process template.
In Azure Devops, the WIT are all controlled by XML template. You can find all rules such as the Reason field value listed depend on the State field changed, copy the value from the Reason field and etc.
I have uploaded the Bug.xml of process template into my github, you can refer to that code to analysis it: Agile-process/Bug.xml .
For the Reason field value listed depend on the State field
changed.
<FIELD name="Resolved Reason" refname="Microsoft.VSTS.Common.ResolvedReason" type="String" reportable="dimension">
<ALLOWEDVALUES>
<LISTITEM value="As Designed" />
<LISTITEM value="Cannot Reproduce" />
<LISTITEM value="Deferred" />
<LISTITEM value="Duplicate" />
<LISTITEM value="Fixed" />
<LISTITEM value="Fixed and verified" />
<LISTITEM value="Obsolete" />
<LISTITEM value="Copied to Backlog" />
</ALLOWEDVALUES>
<HELPTEXT>The reason why the bug was resolved</HELPTEXT>
</FIELD>
These are the xml code which control the Resolved Reason listed. I believe that you have got its logic. The message of event API we got from fiddler are get by the relevant WIT *.xml. Then the corresponding operation will be trigger and acted.
For copy the value from the Reason field.
<TRANSITION from="New" to="Resolved">
<ACTIONS>
<ACTION value="Microsoft.VSTS.Actions.Checkin" />
</ACTIONS>
<REASONS>
<DEFAULTREASON value="Fixed">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ResolvedReason">
<COPY from="value" value="Fixed" />
<ALLOWEDVALUES>
<LISTITEM value="Fixed" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</DEFAULTREASON>
<REASON value="Deferred">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ResolvedReason">
<COPY from="value" value="Deferred" />
<ALLOWEDVALUES>
<LISTITEM value="Deferred" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</REASON>
<REASON value="Duplicate">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ResolvedReason">
<COPY from="value" value="Duplicate" />
<ALLOWEDVALUES>
<LISTITEM value="Duplicate" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</REASON>
<REASON value="As Designed">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ResolvedReason">
<COPY from="value" value="As Designed" />
<ALLOWEDVALUES>
<LISTITEM value="As Designed" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</REASON>
<REASON value="Cannot Reproduce">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ResolvedReason">
<COPY from="value" value="Cannot Reproduce" />
<ALLOWEDVALUES>
<LISTITEM value="Cannot Reproduce" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</REASON>
<REASON value="Obsolete">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ResolvedReason">
<COPY from="value" value="Obsolete" />
<ALLOWEDVALUES>
<LISTITEM value="Obsolete" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</REASON>
<REASON value="Copied to Backlog">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ResolvedReason">
<COPY from="value" value="Copied to Backlog" />
<ALLOWEDVALUES>
<LISTITEM value="Copied to Backlog" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</REASON>
</REASONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<COPY from="field" field="System.CreatedBy" />
</FIELD>
<FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
<SERVERDEFAULT from="clock" />
</FIELD>
<FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
<COPY from="currentuser" />
<VALIDUSER />
<REQUIRED />
</FIELD>
<FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
<COPY from="currentuser" />
<VALIDUSER />
<REQUIRED />
</FIELD>
<FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
<SERVERDEFAULT from="clock" />
</FIELD>
</FIELDS>
</TRANSITION>
This just a short section which about the copy value from the Reason field from the xml file of Bug work item.
In fact, you can find all process rules from these XML file which could not get with API(Note: I just mean the default process rule). If you want, I can share the completed XML files of process in my github.
Hope this could help you more clearly:-)
Is there an API that can give a comprehensive set of rules for fields
on a work item types including the allowedValues of say Reason field
depending on the choice of State field?
For this issue , you can use Rules - List api to get it .
GET https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/rules?api-version=5.1-preview.2
I test with postman , the figure below is the result returned by my test.
By searching for keywords, we can get the rules of allowed values for Reason field depending on the choice of State field.
The processId parameter required in the api can be obtained through this rest api.
Hope this helps.

IBM Watson Dialog - entity not working / resolved

I am trying to get input (say gender - male / female) from user using entity and store it in profile variable and the code snippet below.
<default>
<output>
<prompt selectionType="RANDOM">
<item>I did not quite get that.</item>
</prompt>
</output>
</default>
<input id="input_2508594">
<grammar>
<item>$(Gender)={gender}</item>
<item>I am a
</item>
</grammar>
<action operator="SET_TO" varName="gender">{gender.value:main}</action>
<output>
<prompt selectionType="RANDOM">
<item>Hi hello {gender}!</item>
</prompt>
</output>
</input>
<entities>
<entity name="Gender">
<value name="Male" value="Male"/><value name="Female" value="Female"/>
</entity>
</entities>
<variables>
<var_folder name="Home">
<var description="friend" name="UserName" type="TEXT"/>
<var description="one" name="gender" type="TEXT"/>
</var_folder>
</variables>
Now, if I say "I am a", the dialog service responds with "Hi hello!". But, if i input "Female", WDS responds with default output "I did not quite get that.". Then I tried giving $(Gender)={gender}, it returns "Hi hello!". So, it looks dialog is not resolving the input to entity and I could not store the input into profile variable.
Any advise please? Am I missing anything in the dialog xml file?
Settings should be added in the dialog config file.
<settings>
<setting name="ENTITIES_SCOPE">3</setting>
</settings>
https://developer.ibm.com/answers/questions/238673/dialog-entity-not-working-resolved.html

How to add extra columns in multi-series Column Chart in FusionCharts

I want to show few Bars in the Begining of the graph Which should be excluded in multi-series Column Chart,
Like (A1,A2,A3,A4), Q1(CurrentYear, PreviousYear), Q2(CurrentYear, PreviousYear), Q3(CurrentYear, PreviousYear), Q4(CurrentYear, PreviousYear)
Assuming A1,A2,A3,A4 are Bars to be shown first, Then Q1,Q2,Q3,Q4 are the categories as usual for the multi-Series Column Chart.
I'm using the XML code right now as follows,
<chart caption="Sales in Last Two Years" subcaption="Quarter-wise comparison" xaxisname="Quarter" yaxisname="Sales (In USD)" numberprefix="$" theme="fint">
<categories>
<category label="Q1" />
<category label="Q2" />
<category label="Q3" />
<category label="Q4" />
</categories>
<dataset seriesname="Previous Year">
<set value="10000" />
<set value="11500" />
<set value="12500" />
<set value="15000" />
</dataset>
<dataset seriesname="Current Year">
<set value="25400" />
<set value="29800" />
<set value="21800" />
<set value="26800" />
</dataset>
</chart>
I want to display Four columns as first four column , which should not be the part of multi-series Column Chart.
How can it be done?
Thanks.!
Is your requirement similar to the attached image?

Confluence Macro Browser autocompletion for attachments

I am trying to show all attachments (from the current page) in an auto-completed drop-down list. This is the part in the atlassian-plugin.xml which defines the parameters:
<xhtml-macro name="plugin-name" class="com.example.macro.name" key="macroname-xhtml" icon="/download/resources/${project.groupId}.${project.artifactId}/icons/macroname.png">
<category name="formatting"/>
<parameters>
<parameter name="content_input" type="confluence-content" />
<parameter name="space_input" type="spacekey" />
<parameter name="attachment_input" type="attachment" />
</parameters>
</xhtml-macro>
The confluence-content and spacekey types work just fine. It shows a textfield which autocompletes Pages and Spaces.
However, the attachment type shows a empty drop-down list (select box) which cannot auto-complete.
The official Confluence documentation says it should work like I do:
https://developer.atlassian.com/display/CONFDEV/Including+Information+in+your+Macro+for+the+Macro+Browser
I must be missing something here, but I don't know what. Anyone might know what the problem is?
If you want a drop-down list with all the attachments then you may also try the following:
<xhtml-macro name="plugin-name" class="com.example.macro.name" key="macroname-xhtml" icon="/download/resources/${project.groupId}.${project.artifactId}/icons/macroname.png">
<category name="confluence-content" />
<parameters>
<parameter name="page" type="confluence-content" required="false"
multiple="false" />
<parameter name="name" type="attachment" required="false" />
</parameters>
</xhtml-macro>
Don't change the names of the parameters
If you want to add a filter, then you need the following:
<web-resource key="macro-browser-smart-fields" name="Macro Browser Smart Fields">
<resource type="download" name="confluence-core-macro-fields.js" location="js/confluence-core-macro-fields.js" />
<dependency>confluence.editor.actions:editor-macro-browser</dependency>
<context>macro-browser</context>
</web-resource>
confluence-core-macro-fields.js
(function($) {
AJS.MacroBrowser.activateSmartFieldsAttachmentsOnPage("plugin-name", [ "png", "jpg", "gif" ]);
})(AJS.$);
I found that setting the type as attachment (following official documentation) is bugged. I have found a work-around to display attachments in a auto-complete box.
<parameter name="xsd" type="confluence-content" required="true">
<option key="type" value="attachment"/>
<option key="showKeyInPlaceholder" value="false" />
<option key="showValueInPlaceholder" value="true" />
</parameter>