Skip to content

Instantly share code, notes, and snippets.

@kw0006667
kw0006667 / theme.js
Created March 16, 2020 00:52
Set theme for your Highcharts
Highcharts.theme = {
colors: ['#2b908f', '#90ee7e', '#f45b5b', '#7798BF', '#aaeeee', '#ff0066',
'#eeaaee', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
]};
Highcharts.setOptions(Highcharts.theme);
@kw0006667
kw0006667 / search.js
Created March 16, 2020 00:33
Select points by changing opacity of points in Highcharts
let searchInput = document.getElementById('search');
searchInput.oninput = function(event) {
currentSearch = this.value;
chart.series.forEach(serie => {
serie.points.forEach(point => {
point.update({ color: Highcharts.theme.colors[point.colorIndex] }, false);
});
});
chart.redraw();
@kw0006667
kw0006667 / chart.js
Last active March 16, 2020 00:04
Select point by calling select() method in Highcharts
var searchText = 'US';
var chart = new Highcharts.chart('container', {
series: [{
name: 'Asia',
data: [{
name: 'Taiwan',
value: 87
}, {
name: 'Japan',
value: 86
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 pointMain[225];
uniform int pointNumber;
float Blob(vec2 position, vec2 point, float radius)
{
float temp = pow(position.x - point.x, 2.0) + pow(position.y - point.y, 2.0);
<dict>
<key>HomeScene</key>
<string>首頁</string>
<key>MainScene</key>
<string>主頁</string>
<key>BookScene</key>
<string>百科</string>
<key>GameScene</key>
<string>遊戲</string>
<key>AnimScene</key>
@kw0006667
kw0006667 / main.cpp
Created May 3, 2013 04:51
C++ STL list 的簡單使用 將實體丟入list 後,即使在 list 中移除,原來的實體還是會在
#include <iostream>
#include <list>
#include <algorithm>
#include <string>
using namespace std;
class Sprite
{
public:
@kw0006667
kw0006667 / CXmlStream.cpp
Last active July 1, 2016 18:52
Cocos2d-x Read/Write XML file
#include "CXmlStream.h"
CXmlStream::CXmlStream(const char* dicFilename)
{
this->m_dictionary = CCDictionary::createWithContentsOfFile(dicFilename);
}
CXmlStream::~CXmlStream()
{
@kw0006667
kw0006667 / MainPage.xaml.cs
Created December 4, 2012 16:00
在主畫面,將原來的「首頁」改成「詳細設定」,並建立舉呼叫剛才自訂的子畫面
public MainPage()
{
this.InitializeComponent();
SettingsPane.GetForCurrentView().CommandsRequested += MainPage_CommandsRequested;
}
void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand urlCommand = new SettingsCommand("urlCommand", "詳細設定", onSettingsCommand);
args.Request.ApplicationCommands.Add(urlCommand);
@kw0006667
kw0006667 / SettingPage.xaml.cs
Created December 4, 2012 15:13
在剛新增的頁面裡,增加移入的動畫
const int ContentAnimationOffset = 100;
public SettingPage()
{
this.InitializeComponent();
FlyoutContent.Transitions = new Windows.UI.Xaml.Media.Animation.TransitionCollection();
FlyoutContent.Transitions.Add(new Windows.UI.Xaml.Media.Animation.EntranceThemeTransition()
{
FromHorizontalOffset = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? ContentAnimationOffset : (ContentAnimationOffset * -1)
});
}
@kw0006667
kw0006667 / SettingPage.xaml
Created December 4, 2012 14:57
新增一個頁面,寬度設為346
<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="App2.SettingPage"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App2"
xmlns:common="using:App2.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"