C++ :: Draw 2D Bar Chart According To 10 Or 15 Numbers?

Nov 26, 2013

I want to draw a 2D bar chart according to 10 or 15 numbers in c++. How can i do it? Which i need components?

View 1 Replies


ADVERTISEMENT

C++ :: Array Sales Bar Chart?

Dec 17, 2012

I need to make a bar chart with asterisks that looks like this:

Store 1: ******
Store 2: ***
etc.

anyway, right now what I have is:

Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
const int STORES = 5;
int sales[STORES], i;
for (i = 0; i < STORES; i++) {

[code].....

It's not displaying asterisks.

View 1 Replies View Related

C++ :: Flow Chart For Nested Loop

Jan 6, 2014

how to draw a flow chart for following nested loop?

for(int r=1;r<=5;r++){
for(int c=1;c<=r;++c){
cout<<c;
}
cout<<endl;

View 1 Replies View Related

C :: Make A Live Price Chart Graph

Dec 14, 2013

The only language I know so far is C. Is there any way I can use c programming to display a live chart for a price graph including volume in different time intervals that I want to select. I want it to look like this URL....

View 2 Replies View Related

C# :: Chart In Winform Displaying Wrong Point

Nov 11, 2014

I have the following code. I have hardcoded the x and y values to test. And for some reason for the point (0,-0.5) it plots (1,-0.5) . What is going on, because if you try other values then the graph displays correctly.

foreach (var grp in q) {
point = new DataPoint();
Sum1 = grp.Sum1 > 2 ? 2 : grp.Sum1;
Sum1 = Sum1 < -2 ? -2 : Sum1;

[Code] ....

Attached is what is displayed.

Attached image(s)

View 13 Replies View Related

C# :: Create Line Chart That Will Be Universal For Every Currency

Dec 30, 2014

I need to create a line chart that will be universal for every currency. As Y it will display value of currency, as X it will display time when that value was established.

For drawing I think of using Windows.UI.Xaml.Shapes.Line and Windows.UI.Xaml.Controls.Canvas

What I want to get is something like image below but it would have to draw correctly scaled chart for every currency which is the biggest problem(I think it is).

For every currency I will probably have to get minimal and maximal value which will be used to properly scale a chart(I will probably also have to get rendersize of canvas or something).

The user will choose the range of time and then the correct chart must be drawn (For example 04-11-2004 to 11-03-2007)

It is a windows store project.

View 4 Replies View Related

C Sharp :: How To Move Points Of Chart In C# By Mouse

Nov 27, 2014

I am Trying all the Time to implement in c# moving of points by using Mouse ( Web Applications) and save the new value in array. But not successful ...

View 3 Replies View Related

C/C++ :: Round Robin Execution With Gantt Chart - Arrival Time And Burst Time

Mar 10, 2015

This is a round robin execution. with gantt chart. arrival time and burst time. I think there is an error in my formula to get the right answer,i cant resolve it but my program is running. What is the code or the right formula??

#include<stdio.h>
int main(){
int i,j=0,n,time,remain,flag=0,ts;
int sum_wait=0,sum_turnaround=0,at[10],bt[10],rt[10];
int ganttP[50],ganttStartTime[50];
printf("Enter no of Processes : ");
scanf("%d",&n);
remain=n;

[Code] ....

View 2 Replies View Related

C++ :: How To Draw A Polygon

Nov 16, 2013

I am fairly new to c++, and I want to be able to draw a polygon. When I have searched for how to draw one, the only thing i can find is scripts doing things like this:

*
**
***
****
*****

I doubt that c++ is that primitive, and I'm looking for something like the c++ equivalent of this python script:

Syntax: draw.polygon((20,20)(30,30)(50,30)(20,40)(20,20), fill(green))

I am using a mac os 10.9

View 2 Replies View Related

C :: Draw A Grid Using The Characters?

Aug 20, 2013

I'm trying to create a grid using the following characters: !, @, #, $, &.

It's an 8 x 8 grid, and should contain the characters in no particular order (trying to create a Bejeweled-like game).

I already defined the width and length to be 8, so:

#define WIDTH 8
#define LENGTH 8

Code:

void makegrid(char grid[])
{
int j;
int k;
for ( j = -1; j < LENGTH; j++ )
{
for ( k = -1; k < WIDTH; k++ )
{
/* I don't know what to type here anymore :( */
}
} }

View 14 Replies View Related

C++ :: OpenGL - Draw On Top Of Image

Jun 22, 2014

This is my first time using opengl and I am experimenting with adding/drawing polygons/points/etc. on top of a PPM image. The image is already loaded when the application runs. My attempt to draw a square is from lines 30 - 35. The program runs but the square is not present. Just the image.

#include<windows.h>
#include <stdio.h>
#include <stdlib.h>
#include<Gl/gl.h>
#include<GL/glut.h>

int n;
int m;
int *image;

[Code] ....

View 5 Replies View Related

C++ :: How To Draw A 3D Snake In OpenGL

Jan 3, 2014

i want to draw a 3D snake in opengl.. i can't get nothing out of my search to make a start.. how it is made

View 4 Replies View Related

C++ :: How To Draw Lines With Different Colors

Nov 8, 2014

I want to write a function called DrawLineSegments.This function must change the color of lines at every corner where the corner angle is greater than 60 deg (Assume that there is a function called checkangle). The color sequence must be black, red, green, blue, and repeat this sequence after the fourth color.

View 1 Replies View Related

C++ :: How To Draw A Magnifying Glass

Jul 11, 2013

I want to draw a magnifying glass using graphics.h which is used mostly as "Search" icon. But, I am having problems in making the rectangle attached to the two circles (one inscribed on another) . I have also included the screenshot (made in powerpoint) on how the output will look like, enen I've made most of the part, except the search icon (magnifying glass).

The Link for the screenshot is : [URL] ....

View 3 Replies View Related

C/C++ :: How To Draw Shapes Using Loop

Apr 11, 2014

How can I draw thus shape using loop for
0
0 1
0 1 2
0 1 2 3
0 1 2 3 4
0 1 2 3 4 5

Also this shape
1*****
12****
123***
1234**
12345*
123456

View 6 Replies View Related

C# :: How To Draw More Than One Line In WPF Using Array

Jul 8, 2014

I used the following code. I called a method named lets_draw

private void lets_draw() {
int i,z;
z = 40;
Line[] line = new Line[20];
for(i=1;i<=10;i++) {

[Code] ....

But it showed the following message

"An unhandled exception of type 'System.NullReferenceException' occurred in SkeletalTracking.exe
Additional information: Object reference not set to an instance of an object."

View 1 Replies View Related

C++ :: How To Draw Unoccupied Value From Array

Jan 5, 2015

Let's say there are three slots in my array (3 pieces of hardware to be used). If one worker comes in, it takes an instrument, and I tag it as used on random basis. Next, the next worker comes in, it takes another unused instrument randomly and so on. When the first worker finishes using that instrument, he returns it back to the inventory. How should I write such code in C++?

View 8 Replies View Related

C :: Draw Magen David Star

Apr 18, 2014

problem to draw magen david star ,i find code that draw pyramid of starts. how can i modify this code to receive magen david star ?

Code:
#include <stdio.h>
int main() {
int rows, star, spaces;
char bukva='A';
int number_of_stars = 6;
int number_of_rows = number_of_stars;

[Code]....

View 4 Replies View Related

C# :: Draw Single Pixel On Window

Mar 27, 2014

Im new to c#. In c++ I have made a window and painted it with dots and concentric circles, like a radar PPI screen. Trying to do this in c#, I can't find how to draw a single pixel on the window.

Also, what should I be drawing on: the form, panel, picturebox...?

View 2 Replies View Related

C++ :: Program That Can Draw Total Of Passed Value

Feb 4, 2014

Draw the total of a passed value, or value in general, without checking how many values there are individually.

Here's a pseudo-example:

int aliens = 10; // This should be changed as desired.
void drawaliens(int value) {
aliens.draw(value); // Instead of having a test of how many to draw, draw the amount there is from one check
}

I want to draw the amount of aliens passed or called to the alien draw function.

However, I don't want the function to check every possible value of aliens which could be passed before drawing, and just check the value once and draw that value.

IF x ALIENS, DRAW x ALIENS instead of...

IF 1 ALIEN, DRAW ALIEN(1);
IF 2 ALIEN, DRAW ALIEN(2);
IF 3 ALIEN, DRAW ALIEN(3);
.... and so on.

If there can be hundreds of aliens, it seems impractical to check every single possible value before drawing, and just check the value and draw that value.

View 2 Replies View Related

C++ :: 3D Graphics Programming Using SDL - Draw A Cube?

Apr 24, 2014

Ive been experimenting with 3d graphics by using SDL only and lines to draw 3d shapes (no OpenGL or extension libraries, just pure math),

Ive used this page mainly to guide me on perspective projection but i have no luck [URL] ....

Ive been trying to draw a cube, but instead it gives me a mirrored dual triangular pyramids

This code here rotates the object as seen from the equations in this link: [URL] ....

double aX, aY, aZ;
for ( i = 0; i < model->qLength; i++ ) {
for ( j = 0; j < 4; j++ ) {
aX = model->quadArr[i].pointArr[j].x;
aY = model->quadArr[i].pointArr[j].y;
aZ = model->quadArr[i].pointArr[j].z;

[Code] .....

generally, i project it onto a 2d plane using: [URL] .....

double dx, dy, dz, dX, dY, dZ;
int bx, by, bX, bY;
for ( i = 0; i < model->qLength; i++ ) {
for ( j = 0; j < 4; j++ ) {

[Code] .....

I understand that my code is very messy and unoptimized, but im just concentrating on getting the core concepts to work with my code

View 1 Replies View Related

C++ :: Draw The Same Sprite Multiple Times (SDL)?

Sep 7, 2014

I have a question about SDL and drawing sprites (SDL surfaces). My idea is that the user can create a wall of separate sprites by create one sprite each time in the current mouseX and mouseY position, when the user push down the e-key. The problem is that I have no idea how I could draw the same sprite multiple times without to delete the previous one.

View 3 Replies View Related

C++ :: Draw 2D Grid With Blank Cells?

Mar 21, 2014

I am trying to draw a 2d grid array for a battleships game. I need the grid to have a border around each cell, how to do this. so far my code is:

#include<iostream>
using namespace std;
int main(){
int grid[5][5] = {{0}};

[Code] .....

View 4 Replies View Related

C/C++ :: Draw A 5x5 Grid For Battleships Game

Mar 20, 2014

I'm trying to draw a 5x5 grid for a battleships game.

How to draw the grid with borders and individual cells.

I'm using dev c++

View 14 Replies View Related

C# :: Draw Border Around TableLayoutPanel Cell

Mar 6, 2015

I would like to draw a border arround a cell in a TableLayoutPanel but without also making a connection between the columns. I just want an outer border.

private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e) {
if (e.Row == 0) {
e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Right, e.CellBounds.Top));
e.Graphics.DrawLine(Pens.Black, new Point(e.CellBounds.Left, e.CellBounds.Bottom), new Point(e.CellBounds.Right, e.CellBounds.Bottom));
e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Left, e.CellBounds.Bottom));
}
}

This line

e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Left, e.CellBounds.Bottom));

also paints connections, where i don't want them. How can i just make a outerb order arround a cell and is there a easier way to do it? Here's also an image of what i want. I don't know if i described it right.

View 2 Replies View Related

C/C++ :: How To Draw Rectangle Inside A Circle

Jul 5, 2013

Write a program using turbo c to draw a rectangle inside a circle..........

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved