Skip to content

Instantly share code, notes, and snippets.

View Willy-Kimura's full-sized avatar
🎯
Building front-end experiences

Willy Kimura Willy-Kimura

🎯
Building front-end experiences
View GitHub Profile
@Willy-Kimura
Willy-Kimura / SplineChart.vb
Created November 6, 2017 11:38
Method for generating the Dataviz spline chart - with three splines.
Sub GenerateSpline()
' Create a new canvas for rendering our chart.
Dim canvas1 As New Canvas
' Create the first spline chart datapoints-set.
Dim datapoint_1 As New DataPoint(BunifuDataViz._type.Bunifu_spline)
' Add all the datapoints for the first spline chart.
datapoint_1.addLabely("", "27")
@Willy-Kimura
Willy-Kimura / RunSpline.vb
Created November 6, 2017 13:15
Timer method for running the "GenerateSpline" method.
Private Sub Dashboard_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Add a colorset for beautifying our charts.
BunifuDataViz1.colorSet.Add(Color.FromArgb(60, 158, 241))
BunifuDataViz1.colorSet.Add(Color.FromArgb(39, 180, 109))
BunifuDataViz1.colorSet.Add(Color.FromArgb(255, 60, 49))
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
@Willy-Kimura
Willy-Kimura / RunSpline.cs
Last active November 7, 2017 06:08
Timer method for running the "GenerateSpline" method.
private void Dashboard_Load(object sender, EventArgs e)
{
// Add a colorset for beautifying our charts.
BunifuDataViz1.colorSet.Add(Color.FromArgb(60, 158, 241));
BunifuDataViz1.colorSet.Add(Color.FromArgb(39, 180, 109));
BunifuDataViz1.colorSet.Add(Color.FromArgb(255, 60, 49));
}
@Willy-Kimura
Willy-Kimura / SplineChart.cs
Last active November 7, 2017 06:14
Method for generating the Dataviz spline chart - with three splines.
public void GenerateSpline()
{
// Create a new canvas for rendering our chart.
Canvas canvas1 = new Canvas();
// Create the first spline chart datapoints-set.
DataPoint datapoint_1 = new DataPoint(BunifuDataViz._type.Bunifu_spline);
// Add all the datapoints for the first spline chart.
@Willy-Kimura
Willy-Kimura / MoveIndicator.cs
Last active November 7, 2017 06:18
This moves the separator (indicator) to reflect the position of the clicked label.
public void MoveIndicator(object sender)
{
// Convert the object clicked to a label for easier access to its properties.
Bunifu.Framework.UI.BunifuCustomLabel clicked_label = (Bunifu.Framework.UI.BunifuCustomLabel)sender;
// Set the location of the separator (horizontally) to be below the clicked label.
BunifuSeparator.Location = new Point(clicked_label.Location.X, BunifuSeparator4.Location.Y);
// Set the width of the separator to be equal to the clicked label's width.
@Willy-Kimura
Willy-Kimura / MoveIndicator.vb
Last active November 7, 2017 11:45
This moves the separator (indicator) to reflect the position of the clicked label.
Sub MoveIndicator(ByVal sender As Object)
' Convert the object clicked to a label for easier access to its properties.
Dim clicked_label As Bunifu.Framework.UI.BunifuCustomLabel = CType(sender, Bunifu.Framework.UI.BunifuCustomLabel)
' Set the location of the separator (horizontally) to be below the clicked label.
BunifuSeparator1.Location = New Point(clicked_label.Location.X, BunifuSeparator4.Location.Y)
' Set the width of the separator to be equal to the clicked label's width.
BunifuSeparator1.Width = clicked_label.Width
@Willy-Kimura
Willy-Kimura / TaskItem.vb
Last active November 17, 2017 13:26
Custom TaskItem control class.
' Custom TaskItem Class.
Public Class TaskItem
' This adds a new TaskItem control.
Public Sub Add(ByVal task_label As TaskLabels, ByVal show_separator As Boolean, ByVal task_subject As String, ByVal task_title As String, ByVal task_subtitle As String)
' Set the texts for the three Task values.
subject.Text = task_subject
title.Text = task_title
subtitle.Text = task_subtitle
@Willy-Kimura
Willy-Kimura / TaskItem.cs
Last active November 17, 2017 13:46
Custom TaskItem control class.
// Custom TaskItem Class.
public class TaskItem
{
// This adds a new TaskItem control.
public void Add(TaskLabels task_label, bool show_separator, string task_subject, string task_title, string task_subtitle)
{
// Set the texts for the three Task values.
subject.Text = task_subject;
@Willy-Kimura
Willy-Kimura / AddTasks.vb
Last active November 17, 2017 14:11
This adds a list of TaskItems inside our task-list panel section.
' This adds a new TaskItem inside our task-list panel section.
Sub AddTask(ByVal task_label As TaskItem.TaskLabels, ByVal show_separator As Boolean, ByVal task_subject As String, ByVal task_title As String, ByVal task_subtitle As String)
' Create a new TaskItem and set the required parameters with the "Add" method.
Dim task_item As New TaskItem
task_item.Add(task_label, show_separator, task_subject, task_title, task_subtitle)
' Then set the TaskItem's Dock property to "Top".
task_item.Dock = DockStyle.Top
@Willy-Kimura
Willy-Kimura / AddTasks.cs
Last active November 17, 2017 14:21
This adds a list of TaskItems inside our task-list panel section.
// This adds a new TaskItem inside our task-list panel section.
public void AddTask(TaskItem.TaskLabels task_label, bool show_separator, string task_subject, string task_title, string task_subtitle)
{
// Create a new TaskItem and set the required parameters with the "Add" method.
TaskItem task_item = new TaskItem();
task_item.Add(task_label, show_separator, task_subject, task_title, task_subtitle);
// Then set the TaskItem's Dock property to "Top".
task_item.Dock = DockStyle.Top;