Set additional information in highcharts tooltip - highcharts

Im doing a columnrange highchart, my json sample data is as below:
{
"name": "PW (md.h24mi)",
"data": [
[320, 320.06],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[319.05, 319.1],
[320, 320.04]
],
"PW": [
["PW0000025090"],
["PW0000025158"],
["PW0000025160"],
["PW0000025171"],
["PW0000025172"],
["PW0000025161"],
["PW0000025173"],
["PW0000025159"],
["PW0000025164"],
["PW0000025170"],
["PW0000024827"],
["PW0000024461"]
],
"GROUP": [
["IT"],
["Sierra"],
["Sierra"],
["RF Engineers"],
["RF Engineers"],
["Sierra"],
["RF Engineers"],
["Sierra"],
["RF Engineers"],
["RF Engineers"],
["Sierra"],
["IP"]
],
"worksum": [
["Call Back Assist (CBA) Modification"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["TMA Installation"],
["Upgrade Consumer Wimax Firewall Modules to R77.10"]
]
}
How do i get it to show the "PW" and "worksum" in the tooltip? I've tried the code below but nada.
tooltip: {
formatter: function() {
var point = this.points[0];
return '<b>'+ point.x +'<br />'
+point.PW + '<br />'
+point.worksum + '<br />'
+'</b><br />Duration:'+ point.series.data[0].low +' - '+ point.series.data[0].high;
},
shared: true
}

You have set PW and worksum in series, so you have access in tooltip via point.series.options.PW/worksum. Then you need to extract corresponding value (use this.x). And that's all: http://jsfiddle.net/HsWF2/119/
tooltip: {
formatter: function () {
var point = this.points[0],
series = point.series,
PW = series.options.PW[point.x],
worksum = series.options.worksum[point.x];
return '<b>' + point.x + '<br />' + PW + '<br />' + worksum + '<br />' + '</b><br />Duration:' + point.series.data[0].low + ' - ' + point.series.data[0].high;
},
shared: true
},

Related

A secondary window unexpectedly pops up on clicking notification (via OneSignal) in iOS

Does anyone here have experience integrating push notifications on iOS on OneSignal with mobile apps built using Expo?
I have an app which opens a WebView and this WebView handles all the navigation (i.e. no app routes, instead web routes). The issue is that upon clicking a notification from OneSignal containing a launchURL (a web URL which is supposed to open in the WebView inside the app which I have handled programmatically), a bottom sheet (with a button "Done" on top-right) opens up instead.
You can view the video of the issue here.
My app.json:
{
"expo": {
"name": "Engage | Dev",
"scheme": "fudrengage",
"slug": "fudr-engage-app",
"version": "1.0.14",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "https://assets.fudr.in/assets/images/splash.png",
"resizeMode": "cover",
"backgroundColor": "#EB9658"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "in.fudr.devengage",
"associatedDomains": ["applinks:devengage.fudr.in"]
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"package": "in.fudr.devengage",
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
"data": [
{
"scheme": "https",
"host": "devengage.fudr.in",
"pathPrefix": "/*"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
}
]
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"onesignal-expo-plugin",
{
"mode": "development",
"devTeam": "XXXXXX"
}
],
["./plugins/withAndroidVerifiedLinksWorkaround"]
],
"notification": {
"icon": "./assets/notification-icon.png",
"color": "#EB9658",
"androidMode": "default",
"androidCollapsedTitle": "Updates from Fudr",
"iosDisplayInForeground": true
},
"extra": {
"eas": {
"build": {
"experimental": {
"ios": {
"appExtensions": [
{
"targetName": "OneSignalNotificationServiceExtension",
"bundleIdentifier": "in.fudr.devengage.OneSignalNotificationServiceExtension",
"entitlements": {
"com.apple.security.application-groups": [
"group.in.fudr.devengage.onesignal"
]
}
}
]
}
}
},
"projectId": "xxxxxx"
}
}
}
}
Testing environment:
"react-native-onesignal": "4.4.1"
"onesignal-expo-plugin": "1.1.1"
"expo": "46.0.7"
iOS 16
"react-native": "0.69.5"
As per the OneSignal docs here, the launchURLs that trigger the browser in iOS as well as Android, can be suppressed by adding "OneSignal_suppress_launch_urls": true in the infoPlist key the ios section config in app.json
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.example.sub",
"associatedDomains": ["applinks:sub.example.com"],
"infoPlist": {
"OneSignal_suppress_launch_urls": true
}
},
My App.js was already handling launchURLs inside the WebView as shown below:
export default App = () => {
OneSignal.setAppId("xxxxxx");
const webviewRef = useRef(null);
const [webviewSourceURL, setWebviewSourceURL] = useState("");
useEffect(() => {
// Method for handling notifications opened
OneSignal.setNotificationOpenedHandler((notification) => {
const notificationId = notification?.notification?.notificationId ?? "";
const notificationLaunchUrl = notification?.notification?.launchURL;
const launchURL =
notificationId && notificationLaunchUrl
? `${notificationLaunchUrl}?notificationId=${notificationId}` // Append notificationId as a query parameter to generate a unique URL everytime a new notification is opened; this helps WebView know that it's a new visit
: "";
if (notificationId && launchURL) {
setWebviewSourceURL(launchURL);
}
});
}, []);
return() {
<WebView
ref={webviewRef}
originWhitelist={["*"]}
source={{
uri: webviewSourceURL || FALLBACK_URL,
}}
style={{ marginTop: 20, marginBottom: 5 }}
startInLoadingState={true}
renderLoading={LoadingIndicatorView}
onMessage={onMessage}
/>
}
}

Highcharts: yAxis duration in hours resets every 24h

The image speaks by itself, I want to display a duration in hours on the yAxis. but everytime the value reaches 24h, the yAxis resets to 0. the actual value of the blue bar in the image is 28:19:15 but it shows only 4 hours because it has been resetted (4th value of yAxis shows 0)
my current config:
{
"chart": {
"type": "column"
},
"plotOptions": {
"column": {
"dataLabels": {
"enabled": true
}
}
},
"series": [
{
"data": [
101955467,
0,
0
],
"dataLabels": {
"enabled": true,
"format": "{y:%H:%M:%S}"
},
"name": "duration",
"stack": null,
"yAxis": "1"
}
],
"xAxis": [
{
"categories": [
"cat 1",
"cat 2",
"cat 3"
]
}
],
"yAxis": [
{
"allow_decimals": false,
"dateTimeLabelFormats": {
"day": "%H:%M",
"hour": "%H:%M",
"minute": "%H:%M",
"month": "%H:%M",
"second": "%H:%M",
"week": "%H:%M",
"year": "%H:%M"
},
"id": "1",
"labels": {
"format": "{value:%H:%M:%S}"
},
"max": 101955467,
"min": 0,
"opposite": false,
"title": {
"text": "duration"
},
"type": "datetime"
}
]
}
In fact, you want to get a total time instead of DateTime. In this case, you'll need to create your own label formatter that will convert milliseconds to a number of hours, minutes and seconds.
Example code:
dataLabels: {
enabled: true,
formatter: function() {
let s, m, h;
s = this.y / 1000;
h = parseInt(s / 3600);
s = s % 3600;
m = parseInt(s / 60);
s = (s % 60).toFixed(0);
let number = (h + ":" + m + ":" + s);
return number;
}
}
API Reference:
https://api.highcharts.com/highcharts/series.column.dataLabels.formatter
Demo:
https://jsfiddle.net/BlackLabel/Lcjewr2o/

Electron app Failed to get ipaddress when exported as Flatpak

I am trying to make a Flatpak for my little application “OpenSpeedTest-Server”
This is a simple network performance estimation tool. It is working fine on Windows, Mac and Linux (DEB).
1) When i Export the same in Flatpak, Application unable to get the client device ip address.
2) Also i am not able to put a custom icon for my Flatpak.
I used electronforge.
Here is my package.json
{
"name": "OpenSpeedTest-Server",
"productName": "OpenSpeedTest-Server",
"version": "2.1.0",
"description": "Network Speed Test Server - by OpenSpeedTest",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": {
"name": "OpenSpeedTest",
"email": "support#openspeedtest.com"
},
"license": "MIT",
"config": {
"forge": {
"packagerConfig": {
"icon": "src/icon.png"
},
"makers": [
{
"name": "#electron-forge/maker-flatpak",
"config": {
"name": "OpenSpeedTest_Server",
"options": {
"categories": [
"Utility"
],
"icon": "src/icon.png"
}
}
},
{
"name": "#electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "#electron-forge/maker-deb",
"config": {}
},
{
"name": "#electron-forge/maker-rpm",
"config": {}
}
]
}
},
"dependencies": {
"cors": "^2.8.5",
"electron-squirrel-startup": "^1.0.0",
"express": "^4.17.1",
"internal-ip": "^6.2.0",
"tcp-port-used": "^1.0.2"
},
"devDependencies": {
"#davidwinter/electron-forge-maker-snap": "^2.0.4",
"#electron-forge/cli": "^6.0.0-beta.57",
"#electron-forge/maker-deb": "^6.0.0-beta.57",
"#electron-forge/maker-flatpak": "^6.0.0-beta.57",
"#electron-forge/maker-rpm": "^6.0.0-beta.57",
"#electron-forge/maker-squirrel": "^6.0.0-beta.57",
"#electron-forge/maker-zip": "^6.0.0-beta.57",
"electron": "13.1.2"
}
}
How can i solve this issue?
Solved the issue by adding iproute2 to source and specifying icon dimension. Max supported was 512x512 and i was using 1024x1024
{
"name": "#electron-forge/maker-flatpak",
"config": {
"name": "OpenSpeedTest_Server",
"options": {
"categories": [
"Utility"
],
"icon": {
"512x512": "src/android-chrome-512x512.png"
}
},
"modules": [
{
"name": "zypak",
"sources": [
{
"type": "git",
"url": "https://github.com/refi64/zypak",
"tag": "v2021.02"
}
]
},
{
"name": "iproute2",
"make-install-args": [
"PREFIX=/app",
"CONFDIR=/app/share/iproute2",
"SBINDIR=/app/bin"
],
"sources": [
{
"type": "archive",
"url": "https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-5.7.0.tar.xz",
"sha256": "725dc7ba94aae54c6f8d4223ca055d9fb4fe89d6994b1c03bfb4411c4dd10f21"
}
],
"cleanup": [
"/include",
"/share/bash-completion",
"/share/man"
]
}
]
}
},

travis-ci why the build-passing icon is not set to green upon build ok

all my tests passed and the building icons still grey (error) ...
my travis project
But the icon ( url pasted) on Github ReadMe is passing/green ...
any missing parameter in the travis.yml ?
{
"language": "node_js",
"node_js": "8.4.0",
"sudo": false,
"dist": "trusty",
"addons": {
"chrome": "stable"
},
"cache": {
"yarn": true,
"directories": [
"node_modules"
]
},
"install": [
"yarn"
],
"script": [
"yarn test"
],
"group": "stable",
"os": "linux"
}

Getting “netcoreapp1.0” is an unsupported framework during Docker build

I am creating a ASP.net Core application and I am trying to do a docker build for this application. I am getting following error -
My project.json file is as follows -
{
"dependencies": {
"BundlerMinifier.Core": "2.2.306",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
"Microsoft.NETCore.App": "1.1.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"runtimes": {
"win10-x64": {}
}
}
and my global.json file is as -
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003131"
}
}
I am following dockerfile for docker build -
FROM microsoft/aspnet:1.0.0-rc1-final
ADD . /project
WORKDIR /project
RUN ["dnu", "restore"]
ENTRYPOINT ["dnx", "web", "--server.urls", "http://0.0.0.0:80"]
Please suggest a solution for this one.

Resources