Skip to content

Commit

Permalink
Smaller dots on line charts, text fixes on config, object renaming in…
Browse files Browse the repository at this point in the history
… internals.
  • Loading branch information
andnyb committed Oct 26, 2017
1 parent 72a7fda commit 496c1ad
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 91 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<name>Andreas Nyberg</name>
<url>https://github.com/andnyb/chartjs-multifilter-jira-plugin</url>
</organization>
<name>mfgg</name>
<name>chartjs-multifilter-jira-plugin</name>
<description>Chart.js multi filter plugin for Atlassian JIRA.</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/atlassian-plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<param name="plugin-logo">images/plugin-logo.png</param>
</plugin-info>
<!-- add our web resources -->
<web-resource key="mfgg-resources" name="mfgg Web Resources">
<web-resource key="resources" name="Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="mfgg.css" location="/css/mfgg.css"/>
<resource type="download" name="mfgg.js" location="/js/mfgg.js"/>
<resource type="download" name="images/" location="/images"/>
<context>mfgg</context>
</web-resource>
<gadget key="mfgg" location="mfgg-gadget.xml"/>
<resource type="i18n" name="mfgg" location="org.andnyb.jira.plugin.mfgg"/>
<gadget key="chartjs-multi-filter" location="mfgg-gadget.xml"/>
<resource type="i18n" name="mfgg" location="org.andnyb.jira.plugin.chartjs-multi-filter"/>
<resource type="download" name="thumbnail.png" location="images/chartjs-multifilter-thumb.png"/>
<rest name="Multi Filter Rest Resource" i18n-name-key="multi-filter-rest-resource.name" key="multi-filter-data-resource"
path="/multifilter" version="1.0">
Expand Down
181 changes: 94 additions & 87 deletions src/main/resources/mfgg-gadget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<ModulePrefs
title="Multi Filter Chart.js"
directory_title="Multi Filter Chart.js Gadget"
description="Displays various graphs based on multiple filters."
thumbnail='#staticResourceUrl("org.andnyb.jira.plugin.chartjs-multi-filter:mfgg", "thumbnail.png")'>
description="Include multiple filters in various Chart.js based and interactive charts."
thumbnail='#staticResourceUrl("org.andnyb.jira.plugin.chartjs-multi-filter:chartjs-multi-filter", "thumbnail.png")'>

<Require feature="dynamic-height" />
<Optional feature="auth-refresh"/>
Expand All @@ -19,7 +19,7 @@
<Param name="categories">Other</Param>
</Optional>
#oauth
#supportedLocales("gadget.common,com.andnyb.jira.plugin.mfgg")
#supportedLocales("gadget.common,com.andnyb.jira.plugin.chartjs-multi-filter")
#supportLocales
</ModulePrefs>

Expand Down Expand Up @@ -49,6 +49,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.js"></script>
<canvas id="chart" height="2" width="3"/>
<!--script src="js/mfgg.js" type="text/javascript"></script-->
<script>
var dataSet = {};
(function () {
Expand Down Expand Up @@ -176,20 +177,20 @@
{
id: "filterIdField",
userpref: "filterIdUserPref",
label: "Filter id:",
label: "Filter id(s):",
required: "true",
description: "Comma separated list of filter ids for the issues to display in the graph. Check the browser console log for errors when saving, configuration will not be saved if there are invalid filters.",
description: "Comma separated list of filter ids for the issues to display in the graph. Filter ids are present in the browser URL when selected on the issue search page. Check the browser console log for errors if it not possible to save, configuration will not be saved if there are invalid filters.",
type: "number text",
value: gadget.getPref("filterIdUserPref")
},
{
userpref: "graphLabelUserPref",
label: "Graph labels:",
label: "Graph label(s):",
description: "Comma separated list of labels to use for the plotted graph.",
type: "text",
value: gadget.getPref("graphLabelUserPref")
},
AJS.gadget.fields.nowConfigured()
AJS.gadget.fields.nowConfigured()
]
};
}, // -> descriptor
Expand All @@ -203,95 +204,101 @@
var g = this;
var optionsDef;
if (g.getPref("barTypeUserPref")=="line" ||
g.getPref("barTypeUserPref")=="bar") {
g.getPref("barTypeUserPref")=="bar") {
optionsDef =
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
}
},
scales: {
yAxes: [
{
ticks: {
beginAtZero: true
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
}
},
scales: {
yAxes: [
{
ticks: {
beginAtZero: true
}
}
]
},
elements: {
point: {
radius: 2,
hoverRadius: 3
}
]
}
};
}
};
}
else if (g.getPref("barTypeUserPref")=="doughnut" ||
g.getPref("barTypeUserPref")=="pie") {
g.getPref("barTypeUserPref")=="pie") {
optionsDef =
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
}
}
}
};
};
}
else if (g.getPref("barTypeUserPref")=="horizontalBar") {
optionsDef =
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
}
},
scales: {
xAxes: [
{
ticks: {
beginAtZero: true
}
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
}
]
}
};
},
scales: {
xAxes: [
{
ticks: {
beginAtZero: true
}
}
]
}
};
}
else if (g.getPref("barTypeUserPref")=="stacked") {
optionsDef =
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
}
},
scales: {
xAxes: [
{
ticks: {
beginAtZero: true
},
stacked: true
}
],
yAxes: [
{
stacked: true
{
responsive: true,
layout: {
padding: {
left: 25,
right: 25,
top: 0,
bottom: 0
}
]
}
};
},
scales: {
xAxes: [
{
ticks: {
beginAtZero: true
},
stacked: true
}
],
yAxes: [
{
stacked: true
}
]
}
};
}
var barType = g.getPref("barTypeUserPref");
Expand Down Expand Up @@ -332,12 +339,12 @@
return {
contentType: "application/json",
url: "/rest/multifilter/1.0/data"
+"?filters="+encodeURIComponent(this.getPref("filterIdUserPref"))
+"&labels="+encodeURIComponent(this.getPref("graphLabelUserPref"))
+"&granularity="+this.getPref("granularityUserPref")
+"&category="+this.getPref("categoryUserPref")
+"&type="+this.getPref("barTypeUserPref")
+"&theme="+this.getPref("themeUserPref")
+"?filters="+encodeURIComponent(this.getPref("filterIdUserPref"))
+"&labels="+encodeURIComponent(this.getPref("graphLabelUserPref"))
+"&granularity="+this.getPref("granularityUserPref")
+"&category="+this.getPref("categoryUserPref")
+"&type="+this.getPref("barTypeUserPref")
+"&theme="+this.getPref("themeUserPref")
};
}
}]
Expand Down

0 comments on commit 496c1ad

Please sign in to comment.