WPF- filling color to polyline in for wpf toolkit
I have created a custom LineSeries graph using a polyline. Below image has
plotted two graph ranged from 0-1 and 1.2 to 2 against the date and time.
It demo the expected graph output. I have data structure where I will get
the data from 0-1 and 1.2 to 2.
My problem is I am not able to fill the color when the point is constantly
read 1 till the next drop to 0.
Here is my style
<customSeries:StepLineSeries.Style>
<Style TargetType="customSeries:StepLineSeries">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="customSeries:StepLineSeries">
<Canvas x:Name="PlotArea" >
<Border BorderThickness="0" Background="{Binding
DataContext.SeriesForeColor,
RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type customSeries:StepLineSeries}},
Converter={StaticResource TextToBrushConverter}}">
<Polyline DataContext="{Binding Tag,
RelativeSource={RelativeSource AncestorType={x:Type
customSeries:StepLineSeries}}}"
Points="{TemplateBinding Points}" Stroke="{Binding
DataContext.SeriesForeColor}" Fill="White"/>
</Border>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</customSeries:StepLineSeries.Style>
To Do that I have used Border in the canvas I am filling the color to the
border and making Polyline fill to white always. This approach will not
work for all the case. Can anyone suggest something better than this to
fill the color other than polyline fill
Wednesday, 21 August 2013
Two-column table various problems
Two-column table various problems
Following the page in question: http://jsfiddle.net/EaFZF/
First problem: the image on the left creates an empty space on the right
equal to the height of the image (see the link).
Second problem: how to determine the maximum height of the table? In my
case height: 120px; is ignored. Thanks in advance.
Following the page in question: http://jsfiddle.net/EaFZF/
First problem: the image on the left creates an empty space on the right
equal to the height of the image (see the link).
Second problem: how to determine the maximum height of the table? In my
case height: 120px; is ignored. Thanks in advance.
best practice to know whether mail function send mail or not
best practice to know whether mail function send mail or not
I am using the below code snippet to send mail via php mail function.
$mailsent = mail($to_address, $subject, $message, $headers);
if ($mailsent)
return "mail send";
else
return "error";
I am checking the boolean in $mailsent variable to determine whether the
mail is send successfully or not. Is this the right practice to find the
status of mail send by php mail function. Any help will be
appreciated.Thanks
I am using the below code snippet to send mail via php mail function.
$mailsent = mail($to_address, $subject, $message, $headers);
if ($mailsent)
return "mail send";
else
return "error";
I am checking the boolean in $mailsent variable to determine whether the
mail is send successfully or not. Is this the right practice to find the
status of mail send by php mail function. Any help will be
appreciated.Thanks
Tuesday, 20 August 2013
User define key equivalents
User define key equivalents
I would like to allow the user to create their own key equivalents. Below
is a snap of the prefs page in Google Voice as an example. I'm stumped on
how to record the shortcut in a field as shown below. I've yet to find an
example or any help on this. I would really appreciate any suggestions.
Thanks in advance.
I would like to allow the user to create their own key equivalents. Below
is a snap of the prefs page in Google Voice as an example. I'm stumped on
how to record the shortcut in a field as shown below. I've yet to find an
example or any help on this. I would really appreciate any suggestions.
Thanks in advance.
Simple .Show function not displaying DIV on page load
Simple .Show function not displaying DIV on page load
I have a check box on my page "cbxShowNotifications." If it is checked
when the page loads, I want to SHOW "treeview."
.aspx page:
<html>
<body>
<form>
<asp:CheckBox ID="cbxShowNotifications" runat="server"/>Show
Notifications
<div id="treeview"></div>
</form>
<script src="../Scripts/jquery.min.js" type="text/javascript">
</script>
<script src="../Scripts/kendo.web.min.js" type="text/javascript">
</script>
<script src="../Scripts/NotificationsTreeView.js"
type="text/javascript"> </script>
<script type="text/javascript">
$(document).ready(function()
{
showOrHide();
});
</script>
<script type="text/javascript">
$(document).ready(function()
{
CreateNotificationTree(<%=
UserId.ToString(CultureInfo.InvariantCulture) %>);
});
</script>
</body>
</html>
JavaScript file:
function CreateNotificationTree(userId)
{
var data = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "../api/notifications/byuserid/" + userId,
contentType: "application/json"
}
},
schema: {
model: {
children: "notifications"
}
}
});
$("#treeview").kendoTreeView({
dataSource: data,
loadOnDemand: true,
dataUrlField: "LinksTo",
checkboxes: {
checkChildren: true
},
dataTextField: ["notificationType", "NotificationDesc"],
select: treeviewSelect
});
function treeviewSelect(e)
{
var node = this.dataItem(e.node);
window.open(node.NotificationLink, "_self");
}
}
$('#cbxShowNotifications').on('change', function()
{
debugger;
var tview = $('#treeview');
if ($(this).prop('checked'))
{
tview.show();
}
else
{
tview.hide();
}
});
function showOrHide()
{
debugger;
var tview = $('#treeview');
if ($(this).prop('checked'))
{
tview.show();
}
else
{
tview.hide();
}
}
The problem is, when the page loads AND the check box is checked, the
treeview is NOT visible. What am I doing wrong?
By the way, after the page is loaded, if I uncheck the checkbox, the tree
disappears and if I check it, it appears.
So this is only happening at page load which leads me to believe it's an
issue of WHEN things are being executed.
I have a check box on my page "cbxShowNotifications." If it is checked
when the page loads, I want to SHOW "treeview."
.aspx page:
<html>
<body>
<form>
<asp:CheckBox ID="cbxShowNotifications" runat="server"/>Show
Notifications
<div id="treeview"></div>
</form>
<script src="../Scripts/jquery.min.js" type="text/javascript">
</script>
<script src="../Scripts/kendo.web.min.js" type="text/javascript">
</script>
<script src="../Scripts/NotificationsTreeView.js"
type="text/javascript"> </script>
<script type="text/javascript">
$(document).ready(function()
{
showOrHide();
});
</script>
<script type="text/javascript">
$(document).ready(function()
{
CreateNotificationTree(<%=
UserId.ToString(CultureInfo.InvariantCulture) %>);
});
</script>
</body>
</html>
JavaScript file:
function CreateNotificationTree(userId)
{
var data = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "../api/notifications/byuserid/" + userId,
contentType: "application/json"
}
},
schema: {
model: {
children: "notifications"
}
}
});
$("#treeview").kendoTreeView({
dataSource: data,
loadOnDemand: true,
dataUrlField: "LinksTo",
checkboxes: {
checkChildren: true
},
dataTextField: ["notificationType", "NotificationDesc"],
select: treeviewSelect
});
function treeviewSelect(e)
{
var node = this.dataItem(e.node);
window.open(node.NotificationLink, "_self");
}
}
$('#cbxShowNotifications').on('change', function()
{
debugger;
var tview = $('#treeview');
if ($(this).prop('checked'))
{
tview.show();
}
else
{
tview.hide();
}
});
function showOrHide()
{
debugger;
var tview = $('#treeview');
if ($(this).prop('checked'))
{
tview.show();
}
else
{
tview.hide();
}
}
The problem is, when the page loads AND the check box is checked, the
treeview is NOT visible. What am I doing wrong?
By the way, after the page is loaded, if I uncheck the checkbox, the tree
disappears and if I check it, it appears.
So this is only happening at page load which leads me to believe it's an
issue of WHEN things are being executed.
Dilogarithm integral $\int^x_0 \frac{\operatorname{Li}_2(1-t)\log(1-t)}{t}\, dt$
Dilogarithm integral $\int^x_0
\frac{\operatorname{Li}_2(1-t)\log(1-t)}{t}\, dt$
I am hoping to find a closed form for the following
$$\tag{1} \sum_{k\geq 1}\frac{H_k}{k^3} x^k $$
Using the generating function
$$\sum_{k\geq 1}H^{(n)}_k x^k = \frac{\operatorname{Li}_n(x)}{1-x}$$
I could find this by simple integration
So I am stuck at evaluating
$$\tag{2}\int^x_0 \frac{\operatorname{Li}_2(1-t)\log(1-t)}{t}\, dt$$
For $x=\pm 1$ the problem can be solved , but what about the general case ?
\frac{\operatorname{Li}_2(1-t)\log(1-t)}{t}\, dt$
I am hoping to find a closed form for the following
$$\tag{1} \sum_{k\geq 1}\frac{H_k}{k^3} x^k $$
Using the generating function
$$\sum_{k\geq 1}H^{(n)}_k x^k = \frac{\operatorname{Li}_n(x)}{1-x}$$
I could find this by simple integration
So I am stuck at evaluating
$$\tag{2}\int^x_0 \frac{\operatorname{Li}_2(1-t)\log(1-t)}{t}\, dt$$
For $x=\pm 1$ the problem can be solved , but what about the general case ?
Android EditText exceeded it's parent viewgroup
Android EditText exceeded it's parent viewgroup
As shown in the above screenshot, the EditText exceeded it's parent, how
to prevent this from happening?
In my chat activity I use a ListView to display messages, each message is
a list item
This is the xml file:
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/form"
android:layout_below="@+id/header"
android:divider="@null"
android:dividerHeight="0dp"
android:padding="5dp" >
</ListView>
And list item:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/avatarLeft"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/border"
android:contentDescription="@string/empty_string"
android:src="@drawable/icon_default_avatar"
android:visibility="gone" /> this will be adjusted
programmatically
<TextView
android:id="@+id/comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" this will be adjusted
programmatically
android:layout_margin="5dp"
android:background="@drawable/none" this will be adjusted
programmatically
android:ellipsize="none"
android:paddingLeft="10dp"
android:singleLine="false"
android:text=""
android:textColor="@android:color/primary_text_light" />
<ImageView
android:id="@+id/avatarRight"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/border"
android:contentDescription="@string/empty_string"
android:src="@drawable/icon_default_avatar"
android:visibility="gone" /> this will be adjusted
programmatically
</LinearLayout>
</LinearLayout>
As shown in the above screenshot, the EditText exceeded it's parent, how
to prevent this from happening?
In my chat activity I use a ListView to display messages, each message is
a list item
This is the xml file:
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/form"
android:layout_below="@+id/header"
android:divider="@null"
android:dividerHeight="0dp"
android:padding="5dp" >
</ListView>
And list item:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/avatarLeft"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/border"
android:contentDescription="@string/empty_string"
android:src="@drawable/icon_default_avatar"
android:visibility="gone" /> this will be adjusted
programmatically
<TextView
android:id="@+id/comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" this will be adjusted
programmatically
android:layout_margin="5dp"
android:background="@drawable/none" this will be adjusted
programmatically
android:ellipsize="none"
android:paddingLeft="10dp"
android:singleLine="false"
android:text=""
android:textColor="@android:color/primary_text_light" />
<ImageView
android:id="@+id/avatarRight"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/border"
android:contentDescription="@string/empty_string"
android:src="@drawable/icon_default_avatar"
android:visibility="gone" /> this will be adjusted
programmatically
</LinearLayout>
</LinearLayout>
Subscribe to:
Posts (Atom)