How do you convert a Float64MultiArray message into a PointCloud2 message in ROS?
This is the basic skeleton :
std_msgs::Float64MultiArray map_info;
tf::matrixEigenToMsg(map,map_info );
sensor_msgs::PointCloud2 cloud;
cloud.header.stamp = ros::Time::now();
cloud.width = map_info.end()+1;
cloud.height = 1;
cloud.is_bigendian = false;
cloud.is_dense = false;
sensor_msgs::PointCloud2Modifier modifier(cloud);
modifier.setPointCloud2FieldsByString(1,"xy");
modifier.resize(map_info.end()+1);
sensor_msgs::PointCloud2Iterator<float> out_x(cloud, "x");
sensor_msgs::PointCloud2Iterator<float> out_y(cloud, "y");
for (double i=0;i<map_info.end();i++)
{
*out_x = i;
*out_y = map_info.data[i];
++out_x;
++out_y;
}
Related
Hi we have created a bot making use of dialogflow for controlling natural language and twillio handles the text messaging in the form of whatsapps. We have the following code in our dialogflow fulfillment
const {Firestore} = require('#google-cloud/firestore');
const functions = require('firebase-functions');
const {WebhookClient } = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
const admin = require('firebase-admin');
const {
dialogflow,
Image,
} = require('actions-on-google');
// Create an app instance
const app = dialogflow({
debug: true
});
app.intent('greeting', (conv) => {
console.log('hi');
//agent.add("My ID: " + conv.parameters.my_id.toString());
});
var name = null;
// initialise DB connection
var firebase = require("firebase-admin");
var firebaseConfig = {
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const agent = new WebhookClient({ request, response });
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
function fallback(agent) {
agent.add(`I didn't understand`);
agent.add(`I'm sorry, can you try again?`);
}
function handleName(agent) {
let names = agent.parameters.person;
var temp = names;
// agent.add(agent.requestSource);
var name2 = agent.getContext('1_1_name');
name = name2;
var newData={
name:names.name
};
if((temp != null && temp.name.length < 256 && temp.name.length > 2)){
let myref = firebase.database().ref('Person');
let mGroupId = firebase.database().ref('Person').push().getKey();
return true;
}
else{
agent.add('Invalid name or surname. Please try again');
return false;
}
}
function handleWelcome(agent){
//agent.add(new Image('https://s3.amazonaws.com/botsociety.prod.us/e3d2e0b03f28399a62654d8f52bade457_welcomescreenpng.png'));
agent.add("How can we help you?\n1: Funeral cover family option\n2: Funeral cover nominated option\n3: Add beneficiaries to existing cover\n4: Claim\n5: Contact Details");
//agent.add(sessionId);
return true;
}
function done(agent) {
//agent.add(JSON.parse(agent.parameters).toString());
agent.add("Lol wut");
}
function handleID(agent) {
agent.add('I am a banana.');
const id = agent.parameters.my_id;
var tempID = id.toString();
var valid = true;
if (tempID.length == 13){
}else{
agent.add('Invalid RSA ID number. Please try again');
return false;
}
//Only numerical
for (let x = 0; x < tempID.length; x++){
const d = tempID.charCodeAt(x);
if (d < 48 || d > 57)
valid = false;
}
//Valid citizenship value
if (tempID[10] > 1)
valid = false;
//Odd
var uneven = 0;
for (var x = 0; x <= 10; x += 2){
uneven += parseInt(tempID[x]);
}
//Even
var temp = "";
for (x = 1; x <= 11; x += 2){
temp += tempID[x].toString();
}
var even = parseInt(temp) * 2;
temp = even.toString();
var finalEven = 0;
for (x = 0; x < temp.length; x++){
finalEven += parseInt(temp[x]);
}
//total
var total = finalEven + uneven;
var actualValue = 10 - (total % 10);
//final check
if ((actualValue.toString() !== tempID[12].toString()))
valid = false;
//decide what to do
if (valid){
let myref = firebase.database().ref('Person');
var newData = {
id: id
};
}
else{
agent.add('Invalid RSA ID number. Please try again');
return false;
}
}
let intentMap = new Map();
intentMap.set('Default Welcome Intent', welcome);
intentMap.set('Default Fallback Intent', fallback);
//Names
intentMap.set('1_1_name', handleName);
intentMap.set('1_1_spouse_name', handleName);
intentMap.set('2_1_name', handleName);
intentMap.set('2_beneficiary_name', handleName);
intentMap.set('3_3_name', handleName);
intentMap.set('beneficiary_name_intent', handleName);
intentMap.set('c_2_c_1_name', handleName);
intentMap.set('c_2_c_2_name', handleName);
intentMap.set('c_3_c_1_name', handleName);
intentMap.set('c_3_c_2_name', handleName);
intentMap.set('c_3_c_3_name', handleName);
intentMap.set('c_4_c_1_name', handleName);
intentMap.set('c_4_c_2_name', handleName);
intentMap.set('c_4_c_3_name', handleName);
intentMap.set('c_4_c_4_name', handleName);
intentMap.set('child_1_name_intent', handleName);
//IDs
intentMap.set('1_1_id', handleID);
intentMap.set('1_1_spouse_id', handleID);
intentMap.set('2_1_id', handleID);
intentMap.set('2_beneficiary_id', handleID);
intentMap.set('3_3_id', handleID);
intentMap.set('beneficiary_id_intent', handleID);
intentMap.set('c_2_c_1_id', handleID);
intentMap.set('c_2_c_2_id', handleID);
intentMap.set('c_3_c_1_id', handleID);
intentMap.set('c_3_c_2_id', handleID);
intentMap.set('c_3_c_3_id', handleID);
intentMap.set('c_4_c_1_id', handleID);
intentMap.set('c_4_c_2_id', handleID);
intentMap.set('c_4_c_3_id', handleID);
intentMap.set('c_4_c_4_id', handleID);
intentMap.set('child_1_id_intent', handleID);
intentMap.set('anything_else_no', done);
// intentMap.set('your intent name here', yourFunctionHandler);
// intentMap.set('your intent name here', googleAssistantHandler);
agent.handleRequest(intentMap);
}}
Now the method I am most concerned with is the following.
function handleID(agent) {
agent.add('I am a banana.');
const id = agent.parameters.my_id;
var tempID = id.toString();
var valid = true;
if (tempID.length == 13){
}else{
agent.add('Invalid RSA ID number. Please try again');
return false;
}
//Only numerical
for (let x = 0; x < tempID.length; x++){
const d = tempID.charCodeAt(x);
if (d < 48 || d > 57)
valid = false;
}
//Valid citizenship value
if (tempID[10] > 1)
valid = false;
//Odd
var uneven = 0;
for (var x = 0; x <= 10; x += 2){
uneven += parseInt(tempID[x]);
}
//Even
var temp = "";
for (x = 1; x <= 11; x += 2){
temp += tempID[x].toString();
}
var even = parseInt(temp) * 2;
temp = even.toString();
var finalEven = 0;
for (x = 0; x < temp.length; x++){
finalEven += parseInt(temp[x]);
}
//total
var total = finalEven + uneven;
var actualValue = 10 - (total % 10);
//final check
if ((actualValue.toString() !== tempID[12].toString()))
valid = false;
//decide what to do
if (valid){
let myref = firebase.database().ref('Person');
var newData = {
id: id
};
}
else{
agent.add('Invalid RSA ID number. Please try again');
return false;
}
}
This function is meant for validating an ID that the user provides us and works perfectly within the testing system within dialogflow test console. It is also connected to a twillio account and when we whatsapp a certain number it acts in the same way. However the validate ID function does not seem to work within twillio. It works perfectly when tested in the console but does not work well when the user uses the twillio whatsapp number.
Any suggestions as to way it does not work with the twillio integration? Thank you very much.
Edit when looking through the firebase logs I get the following error message
Error: No responses defined for platform: twilio
at WebhookClient.send_ (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13)
at promise.then (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
I generate a Aspose.Generate.Pdf file and then add a Aspose.Pdf.Generator.Tableto it by following method. but when I add watermark to this pdf file, it covers by created table:
public static BasketResult<string> ExportDataTableToPdf(DataTable inputDataTable, string CaptionFilename)
{
List<DataColumn> listDataColumns = GetDataColumns(inputDataTable, CaptionFilename);
BasketResult<string> returnResult = new BasketResult<string>();
String rtnPathFile = String.Empty;
int rowCount = inputDataTable.Rows.Count;
if (rowCount <= 1000)
{
try
{
string dataDir = Settings.TempPath;
if (!Directory.Exists(dataDir))
Directory.CreateDirectory(dataDir);
Pdf pdfConv = new Pdf();
pdfConv.IsRightToLeft = true;
Aspose.Pdf.Generator.Section mainSection = pdfConv.Sections.Add();
mainSection.TextInfo.IsRightToLeft = true;
mainSection.IsLandscape = true;
mainSection.TextInfo.Alignment = AlignmentType.Right;
// header definition begin
Aspose.Pdf.Generator.HeaderFooter header = new Aspose.Pdf.Generator.HeaderFooter(mainSection);
mainSection.EvenHeader = header;
mainSection.OddHeader = header;
header.Margin.Top = 50;
Aspose.Pdf.Generator.Table headerTable = new Aspose.Pdf.Generator.Table();
header.Paragraphs.Add(headerTable);
headerTable.DefaultCellBorder = new BorderInfo((int)BorderSide.All, 0.1F);
headerTable.Alignment = AlignmentType.Right;
headerTable.DefaultColumnWidth = "80";
headerTable.FixedHeight = 30;
Aspose.Pdf.Generator.Row headerRow = headerTable.Rows.Add();
headerRow.BackgroundColor = new Aspose.Pdf.Generator.Color("#D3DFEE");
int index = 0;
listDataColumns.Reverse();
foreach (DataColumn column in listDataColumns)
{
string cellText = column.Caption;
headerRow.Cells.Add(cellText);
headerRow.Cells[index].DefaultCellTextInfo.FontName = "Tahoma";
headerRow.Cells[index].DefaultCellTextInfo.IsRightToLeft = true;
headerRow.Cells[index].VerticalAlignment = VerticalAlignmentType.Center;
headerRow.Cells[index++].Alignment = AlignmentType.Center;
}
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Aspose.Words.Tables.Table wordTable = ImportTableFromDataTable(builder, inputDataTable,
CaptionFilename, true);
string columnWidths = "";
for (int j = 0; j < wordTable.FirstRow.Count; j++)
{
columnWidths = columnWidths + "80 ";
}
Aspose.Pdf.Generator.Table table = new Aspose.Pdf.Generator.Table();
mainSection.Paragraphs.Add(table);
table.ColumnWidths = columnWidths;
table.DefaultCellBorder = new BorderInfo((int)BorderSide.All, 0.1F);
table.Alignment = AlignmentType.Right;
//fill table
for (int i = 1; i < wordTable.Rows.Count; i++)
{
Aspose.Pdf.Generator.Row row = table.Rows.Add();
row.BackgroundColor = i % 2 == 0
? new Aspose.Pdf.Generator.Color("#D3DFEE")
: new Aspose.Pdf.Generator.Color("#FFFFFF");
var wordTableRow = wordTable.Rows[i];
//fill columns from end to begin because table is left to right
for (int c = wordTable.FirstRow.Count - 1; c >= 0; c--)
{
var cellValue = wordTableRow.ChildNodes[c];
string cellText = cellValue.GetText();
row.Cells.Add(cellText);
}
//set style to every cell
for (int c = 0; c < wordTable.FirstRow.Count; c++)
{
row.Cells[c].DefaultCellTextInfo.FontName = "Tahoma";
row.Cells[c].DefaultCellTextInfo.IsRightToLeft = true;
row.Cells[c].VerticalAlignment = VerticalAlignmentType.Center;
row.Cells[c].Alignment = AlignmentType.Center;
}
}
pdfConv.SetUnicode();
rtnPathFile = Helper.GetTempFile() + ".pdf";
string fileName = Helper.GetFileNameFromFilePath(rtnPathFile);
pdfConv = AddPdfWatermark(pdfConv);
pdfConv.Save(dataDir + fileName);
returnResult.Result.Add(rtnPathFile);
returnResult.IsSuccess = true;
}
catch (Exception ex)
{
rtnPathFile = String.Empty;
returnResult.IsSuccess = false;
returnResult.Result.Add(rtnPathFile);
returnResult.persianErrorMessages.Add(Messages.Err_InvalidFilePath);
}
}
else
{
returnResult.IsSuccess = false;
returnResult.Result.Add(rtnPathFile);
returnResult.persianErrorMessages.Add(Messages.Err_CreateFile);
}
return returnResult;
}
and AddPdfWatermerk method is :
private static Pdf AddPdfWatermark(Aspose.Pdf.Generator.Pdf pdfConv)
{
try
{
// Create FloatingBox with x as width and y as height
Aspose.Pdf.Generator.FloatingBox background = new Aspose.Pdf.Generator.FloatingBox(); // width, height
Aspose.Pdf.Generator.Image backImage = new Aspose.Pdf.Generator.Image();
string path = HttpContext.Current.Server.MapPath("~/images/PrivateExcelBackGround.png");
byte[] bgBuffer = File.ReadAllBytes(path);
MemoryStream streamBack = new MemoryStream(bgBuffer, false);
backImage.ImageInfo.ImageStream = streamBack;
background.Paragraphs.Add(backImage);
background.ZIndex = 1000;
pdfConv.Watermarks.Add(background);
pdfConv.IsWatermarkOnTop = false;
return pdfConv;
}
catch
{
return pdfConv;
}
}
I tried stamp instead of watermark, but table masks it too.
in aspose.words.document file I have a problem too, in word file with mentioned table,watermark added correctly but when a colored alternate table rows, watermark covered by colorful rows.
You are using an out-dated version of Aspose.PDF API. Kindly upgrade to Aspose.PDF for .NET 18.1, which includes more features and bug fixes. You can add an image stamp by using below code snippet in your environment.
// Open document
Document pdfDocument = new Document(dataDir+ "AddImageStamp.pdf");
// Create image stamp
ImageStamp imageStamp = new ImageStamp(dataDir + "aspose-logo.jpg");
imageStamp.Background = true;
imageStamp.XIndent = 100;
imageStamp.YIndent = 100;
imageStamp.Height = 300;
imageStamp.Width = 300;
imageStamp.Rotate = Rotation.on270;
imageStamp.Opacity = 0.5;
// Add stamp to particular page
pdfDocument.Pages[1].AddStamp(imageStamp);
dataDir = dataDir + "AddImageStamp_out.pdf";
// Save output document
pdfDocument.Save(dataDir);
ImageStamp class provides the properties necessary for creating an image-based stamp, such as height, width, opacity etc. You may visit Adding stamp in a PDF file for further information on this topic. In case you notice any problem with the file generated by using this code, please get back to us with source and generated file so that we may proceed to help you out.
I work with Aspose as Developer Evangelist.
For some reason, the following line in my app is returned NULL, and thus, crashes my app:
NSString *address = [session user][#"field_street_address"][#"und"][0][#"safe_value"];
Which, I don't understand, as my console below states that data is returned for field_street_address. Is there something wrong with that line that I'm just not seeing? I've been staring at this for a while and I feel like I'm missing something obvious.
ViewController.m
NSDictionary *userDictInfo = (NSDictionary*) [NSKeyedUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:#"diosSession"]];
DIOSSession *session = [DIOSSession sharedSession];
[session setUser:userDictInfo];
[session user];
NSString *address = [session user][#"field_street_address"][#"und"][0][#"safe_value"];
Console ([session user] log):
2017-10-06 14:06:22.226970-0700 app[828:193706] {
sessid = "DRY0fOXtO_FZOIeowFVVq8oalaFnKSe";
"session_name" = SESS2bb8896be0f16543ff3c6a;
token = giCdHBuw967IaSxDB34m0Evzf1HI3DIK6;
user = {
access = 1507310936;
created = 1459875505;
data = {
"ckeditor_auto_lang" = t;
"ckeditor_default" = t;
"ckeditor_lang" = en;
"ckeditor_show_toggle" = t;
"ckeditor_width" = "100%";
};
"field_address" = {
und = (
{
format = "<null>";
"safe_value" = "1325 Fake Street";
value = "1325 Fake Street";
}
);
};
"field_childrenunder" = {
und = (
{
format = "<null>";
"safe_value" = No;
value = No;
}
);
};
"field_city" = {
und = (
{
format = "<null>";
"safe_value" = Van;
value = Van;
}
);
};
"field_emergency_facility" = {
und = (
{
format = "<null>";
"safe_value" = Yes;
value = Yes;
}
);
};
"field_first_name" = {
und = (
{
format = "<null>";
"safe_value" = Brittany;
value = Brittany;
}
);
};
"field_last_name" = {
und = (
{
format = "<null>";
"safe_value" = B;
value = B;
}
);
};
"field_phonenumber" = {
und = (
{
format = "<null>";
"safe_value" = 2369893091;
value = 2369893091;
}
);
};
"field_photo_path" = {
und = (
{
format = "<null>";
"safe_value" = "sites/default/files/stored/1507092784.jpg";
value = "sites/default/files/stored/1507092784.jpg";
}
);
};
"field_points_balance" = {
und = (
{
format = "<null>";
"safe_value" = 12;
value = 12;
}
);
};
"field_postal_code" = {
und = (
{
format = "<null>";
"safe_value" = 000000;
value = 000000;
}
);
};
"field_private_message_notify" = {
und = (
{
value = 1;
}
);
};
"field_profile_photo" = {
und = (
{
alt = "";
fid = 237;
"field_file_image_alt_text" = (
);
"field_file_image_title_text" = (
);
filemime = "image/jpeg";
filename = "1507092784.jpg";
filesize = 16084;
height = 296;
metadata = {
height = 296;
width = 300;
};
"rdf_mapping" = (
);
status = 1;
timestamp = 1507108254;
title = "";
type = image;
uid = 47;
uri = "public://stored/1507092784.jpg";
width = 300;
}
);
};
"field_property_type" = {
und = (
{
format = "<null>";
"safe_value" = House;
value = House;
}
);
};
"field_province" = {
und = (
{
format = "<null>";
"safe_value" = BC;
value = BC;
}
);
};
"field_special_skills" = {
und = (
{
format = "<null>";
"safe_value" = "Oral medication";
value = "Oral medication";
}
);
};
"field_star_rating" = {
und = (
{
format = "<null>";
"safe_value" = 1;
value = 1;
}
);
};
"field_street_address" = {
und = (
{
format = "<null>";
"safe_value" = "1325 Fake Street";
value = "1325 Fake Street";
}
);
};
"field_supervision" = {
und = (
{
format = "<null>";
"safe_value" = No;
value = No;
}
);
};
"field_userbio" = {
und = (
{
format = "<null>";
"safe_value" = "Hi my name is Brittany.";
value = "Hi my name is Brittany.";
}
);
};
language = "";
login = 1507320712;
mail = "brittany-b#shaw.ca";
name = Brittany;
picture = "<null>";
"rdf_mapping" = {
homepage = {
predicates = (
"foaf:page"
);
type = rel;
};
name = {
predicates = (
"foaf:name"
);
};
rdftype = (
"sioc:UserAccount"
);
};
roles = {
2 = "authenticated user";
};
signature = "";
"signature_format" = "filtered_html";
status = 1;
theme = "";
timezone = UTC;
uid = 47;
};
}
If the log output in your question is from logging [session user] then you need to first access the #"user" key.
NSString *address = [session user][#"user"][#"field_street_address"][#"und"][0][#"safe_value"];
BTW - for issues like this it really helps to break down the code:
NSDictionary *sessionUser = [session user];
NSDictionary *user = sessionUser[#"user"];
NSDicitonary *streetAddr = user[#"field_street_address"];
// etc.
Then you can see where you start getting nil and look at the previous results to determine where things are going wrong.
I am drawing a pie chart using Devexpress in my MVC project.
While doing it by default my chart generated with three colors, as below
but my client is not satisfied, with the colors of it and wanted me to change them which match with our application background, so please help me, how to do this.
Thanks in advance.
Here is my code.
settings.Name = "chart";
settings.Width = 600;
settings.Height = 250;
settings.BorderOptions.Visible = false;
Series series1 = new Series("Type", DevExpress.XtraCharts.ViewType.Pie3D);
settings.Series.Add(series1);
series1.ArgumentScaleType = ScaleType.Qualitative;
series1.ArgumentDataMember = "ClassName";
series1.ValueScaleType = ScaleType.Numerical;
series1.ValueDataMembers.AddRange(new string[] { "PercentageValues" });
series1.LegendPointOptions.PointView = PointView.ArgumentAndValues;
series1.LegendPointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
series1.LegendPointOptions.ValueNumericOptions.Precision = 0;
series1.Label.ResolveOverlappingMode = ResolveOverlappingMode.Default;
series1.Label.Visible = false;
Please refer the following code. I have successfully implemented the same for giving custom color for rangebar. I guess it will work for your case also
settings.CustomDrawSeriesPoint = (s, ev) =>
{
BarDrawOptions drawOptions = ev.SeriesDrawOptions as BarDrawOptions;
if (drawOptions == null)
return;
Color colorInTarget = Color.Blue;
double x = ev.SeriesPoint.Values[0];
double y = ev.SeriesPoint.Values[1];
if (x == 0)
{ //Do starting
colorInTarget = Color.FromArgb(159,125, 189);
}
else{
//Red - price Increase
// Green price Decrease
if (y > previousYValue)
{
colorInTarget = Color.Red; ;
}
else
{
colorInTarget = Color.Green;
}
}
previousYValue = y;
drawOptions.Color = colorInTarget;
drawOptions.FillStyle.FillMode = FillMode.Solid;
drawOptions.Border.Color = Color.Transparent;
};
you can set the theme and palette properties of the chart control. follow the links below to devexpress documentation. although the examples refers to winform application they are still avaliable in asp.net mvc controls.
http://documentation.devexpress.com/#WindowsForms/CustomDocument7433
http://documentation.devexpress.com/#WindowsForms/CustomDocument5538
// Define the chart's appearance and palette.
barChart.AppearanceName = "Dark";
barChart.PaletteName = "Opulent";
private List<StudentClass.ChartsPointsSummary> GetStudentSummaryResults()
{
var StudentId = Convert.ToInt32(Request.Params["StudentID"]);
var StudentDetailsP = CtxSM.SMISGet_StudentAttendanceDetailsByStudentId(StudentId, SessionDataManager.SessionData.LoginUserId, SessionDataManager.SessionData.AcademicYearID, SessionDataManager.SessionData.BusinessUnitId, ref outError).ToList();
var Presents = StudentDetailsP.Select(p => new { p.Months, p.Presents});
var CountsP = StudentDetailsP.Count();
List<StudentClass.ChartsPointsSummary> MT = new List<StudentClass.ChartsPointsSummary>();
foreach (var ab in Presents)
{
MT.Add(new StudentClass.ChartsPointsSummary { PresentSummaryX = ab.Months, PresentSummaryY = Convert.ToInt32(ab.Presents) });
}
var StudentDetailsA = CtxSM.SMISGet_StudentAttendanceDetailsByStudentId(StudentId, SessionDataManager.SessionData.LoginUserId, SessionDataManager.SessionData.AcademicYearID, SessionDataManager.SessionData.BusinessUnitId, ref outError).ToList();
var Absents = StudentDetailsP.Select(p => new { p.Months, p.Absents });
var CountsA = StudentDetailsA.Count();
foreach (var ab in Absents)
{
MT.Add(new StudentClass.ChartsPointsSummary { AbsentSummaryX = ab.Months, AbsentSummaryY = Convert.ToInt32(ab.Absents) });
}
var StudentDetailsL = CtxSM.SMISGet_StudentAttendanceDetailsByStudentId(StudentId, SessionDataManager.SessionData.LoginUserId, SessionDataManager.SessionData.AcademicYearID, SessionDataManager.SessionData.BusinessUnitId, ref outError).ToList();
var CountL = StudentDetailsL.Count();
var Leaves = StudentDetailsP.Select(p => new { p.Months, p.Leaves });
foreach (var ab in Leaves)
{
MT.Add(new StudentClass.ChartsPointsSummary { LeaveSummaryX = ab.Months, LeaveSummaryY = Convert.ToInt32(ab.Leaves) });
}
return MT;
}
#Html.DevExpress().Chart(settings =>
{
settings.Name = "SummaryDetailsById";
settings.Width = 1032;
settings.Height = 250;
Series chartSeries = new Series("Presents", DevExpress.XtraCharts.ViewType.Bar);
chartSeries.ArgumentDataMember = "PresentSummaryX";
chartSeries.ValueDataMembers[0] = "PresentSummaryY";
settings.Series.Add(chartSeries);
Series chartSeries2 = new Series("Absents", DevExpress.XtraCharts.ViewType.Bar);
chartSeries2.ArgumentDataMember = "AbsentSummaryX";
chartSeries2.ValueDataMembers[0] = "AbsentSummaryY";
settings.Series.Add(chartSeries2);
Series chartSeries3 = new Series("Leaves", DevExpress.XtraCharts.ViewType.Bar);
chartSeries3.ArgumentDataMember = "LeaveSummaryX";
chartSeries3.ValueDataMembers[0] = "LeaveSummaryY";
settings.Series.Add(chartSeries3);
settings.CrosshairEnabled = DefaultBoolean.Default;
settings.BackColor = System.Drawing.Color.Transparent;
settings.BorderOptions.Visibility = DefaultBoolean.True;
settings.Titles.Add(new ChartTitle()
{
Text = "Student Attendance Summary"
});
XYDiagram diagram = ((XYDiagram)settings.Diagram);
diagram.AxisX.Label.Angle = -30;
diagram.AxisY.Interlaced = true;
}).Bind(Model).GetHtml()
im new in action scripts and flash, i need some help with this code i couldnt find whats wrong with it, it gives this error:1151: A conflict exists with definition i in namespace internal.(var i:Number = 0;)
stop();
menu_item_group.menu_item._visible = false;
var spacing:Number = 5;
var total:Number = menu_label.length;
var distance_y:Number = menu_item_group.menu_item._height + spacing;
var i:Number = 0;
for( ; i < total; i++ )
{
menu_item_group.menu_item.duplicateMovieClip("menu_item"+i, i);
menu_item_group["menu_item"+i]._x = menu_item._x;
menu_item_group["menu_item"+i]._y = i * distance_y;
menu_item_group["menu_item"+i].over = true;
menu_item_group["menu_item"+i].item_text.text = menu_label[i];
menu_item_group["menu_item"+i].item_url = menu_url[i];
menu_item_group["menu_item"+i].onRollOver = function()
{
this.over = false;
}
menu_item_group["menu_item"+i].onRollOut = menu_item_group["menu_item"+i].onDragOut = function()
{
this.over = true;
}
menu_item_group["menu_item"+i].onRelease = function()
{
getURL(this.item_url);
}
menu_item_group["menu_item"+i].onEnterFrame = function()
{
if( this.over == true ) this.prevFrame();
else this.nextFrame();
}
}
thanks for your help!
Check your code. The variable i has been declared in the code already.